|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Getting all properties of a directoryHi,
In one of the posts, following code is suggested by you for getting all the properties of a directory with better performance. Copy of that post is below: -------------------- Instead of fetching properties recursively with getDir/getFile calls, you may try using SVNRepository.status method to get properties for all files in repository: final long rev = repos.getLatestRevision(); ISVNReporterBaton reporter = new ISVNReporterBaton() { public void report(ISVNReporter reporter) throws SVNException { reporter.setPath("", null, rev, true); reporter.finishReport(); } }; ISVNEditor editor = new ISVNEditor() { public void addDir(...) { } public void addFile(...) { } public void changeDirProperty(...) { } public void changeFileProperty(...){ } .... }; repos.status(rev, null, true, reporter, editor); --------------------------- I am lost here and not sure how to get all the properties of a directory. Do i need to provide all properties of a directory one by one to editor.changeDirProperty(String, String)??? Where is the value of property is returned as i can see the changeDirProperty does not return anything. Is there anyway, that i dont have to give properties to this method at all and get all the properties names and values? Kindly help, thanks. |
|
|
Re: Getting all properties of a directoryHello,
> I am lost here and not sure how to get all the properties of a directory. Do > i need to provide all properties of a directory one by one to > editor.changeDirProperty(String, String)??? Where is the value of property > is returned as i can see the changeDirProperty does not return anything. Is > there anyway, that i dont have to give properties to this method at all and > get all the properties names and values? Kindly help, thanks. In that example you do not have to call changeDirProperty method at all - quite opposite - this method of your ISVNEditor implementation (anonymous class in the example) will be called by SVNRepository.status method and you will receive property name and value in changeDirProperty - which is part of your implementation of ISVNEditor interface. Alexander Kitaev, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! svncheeta wrote: > Hi, > In one of the posts, following code is suggested by you for getting all > the properties of a directory with better performance. Copy of that post is > below: > > -------------------- > Instead of fetching properties recursively with getDir/getFile calls, > you may try using SVNRepository.status method to get properties for all > files in repository: > > final long rev = repos.getLatestRevision(); > ISVNReporterBaton reporter = new ISVNReporterBaton() { > public void report(ISVNReporter reporter) throws SVNException { > reporter.setPath("", null, rev, true); > reporter.finishReport(); > } > }; > ISVNEditor editor = new ISVNEditor() { > public void addDir(...) { > } > public void addFile(...) { > } > public void changeDirProperty(...) { > } > public void changeFileProperty(...){ > } > .... > }; > repos.status(rev, null, true, reporter, editor); > > --------------------------- > > I am lost here and not sure how to get all the properties of a directory. Do > i need to provide all properties of a directory one by one to > editor.changeDirProperty(String, String)??? Where is the value of property > is returned as i can see the changeDirProperty does not return anything. Is > there anyway, that i dont have to give properties to this method at all and > get all the properties names and values? Kindly help, thanks. --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
|
|
Re: Getting all properties of a directoryHello,
You can now also take a look at an article and example code source devoted to this problem: https://wiki.svnkit.com/Recursively%20fetching%20properties%20from%20a%20repository%20(low-level%20API) https://wiki.svnkit.com/Recursively%20fetching%20properties%20from%20a%20repository%20in%20a%20single%20request ---- Alexander Sinyushkin, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! svncheeta wrote: > Hi, > In one of the posts, following code is suggested by you for getting all > the properties of a directory with better performance. Copy of that post is > below: > > -------------------- > Instead of fetching properties recursively with getDir/getFile calls, > you may try using SVNRepository.status method to get properties for all > files in repository: > > final long rev = repos.getLatestRevision(); > ISVNReporterBaton reporter = new ISVNReporterBaton() { > public void report(ISVNReporter reporter) throws SVNException { > reporter.setPath("", null, rev, true); > reporter.finishReport(); > } > }; > ISVNEditor editor = new ISVNEditor() { > public void addDir(...) { > } > public void addFile(...) { > } > public void changeDirProperty(...) { > } > public void changeFileProperty(...){ > } > .... > }; > repos.status(rev, null, true, reporter, editor); > > --------------------------- > > I am lost here and not sure how to get all the properties of a directory. Do > i need to provide all properties of a directory one by one to > editor.changeDirProperty(String, String)??? Where is the value of property > is returned as i can see the changeDirProperty does not return anything. Is > there anyway, that i dont have to give properties to this method at all and > get all the properties names and values? Kindly help, thanks. --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
| Free Forum Powered by Nabble | Forum Help |