|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Create SVNLogEntryPath from SVNLogEntryHello all,
a try to access the history from a svn repository directory like this: Iterator it = invalidEntrys.iterator(); while(it.hasNext()) { SVNURL url = repos.getLocation(); String entry = (String) it.next(); String dir = entry.substring(0, entry.lastIndexOf("/")); url = url.appendPath(dir, false); logClient.doLog(url, null, SVNRevision.HEAD, SVNRevision.parse("1"), SVNRevision.HEAD, false, true, 0, new ISVNLogEntryHandler() { public void handleLogEntry(SVNLogEntry arg0) throws SVNException { System.out.println(arg0.getChangedPaths().values()); SVNLogEntryPath entryPath = (SVNLogEntryPath) arg0.getChangedPaths().values(); } }); } This line: SVNLogEntryPath entryPath = (SVNLogEntryPath) arg0.getChangedPaths().values(); does not work: org.tmatesoft.svn.core.internal.util.SVNHashMap$ValueCollection cannot be cast to org.tmatesoft.svn.core.SVNLogEntryPath java.lang.ClassCastException: org.tmatesoft.svn.core.internal.util.SVNHashMap$ValueCollection cannot be cast to org.tmatesoft.svn.core.SVNLogEntryPath at org.technisat.checkurl.CheckURL$1.handleLogEntry(CheckURL.java:124) at org.tmatesoft.svn.core.wc.SVNLogClient$2.handleLogEntry(SVNLogClient.java:783) at org.tmatesoft.svn.core.internal.io.dav.DAVRepository$1.handleLogEntry(DAVRepository.java:597) How can I create a SVNLogEntryPath object from SVNLogEntry? Many thanks and best regards, Sandro Frenzel |
||||||||
|
|
Re: Create SVNLogEntryPath from SVNLogEntryHello Sandro,
Your casting is invalid and it is what the stack trace reports about. You should iterate over a Map object, like this: for (Iterator pathsIter = arg0.getChangedPaths().keySet().iterator(); pathsIter.hasNext();) { String path = (String) pathsIter.next(); SVNLogEntryPath logEntryPath = (SVNLogEntryPath) arg0.getChangedPaths.get(path); } ---- Alexander Sinyushkin, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! Sandro F wrote: > Hello all, > > a try to access the history from a svn repository directory like this: > > Iterator it = invalidEntrys.iterator(); > while(it.hasNext()) { > SVNURL url = repos.getLocation(); > String entry = (String) it.next(); > String dir = entry.substring(0, > entry.lastIndexOf("/")); > url = url.appendPath(dir, false); > logClient.doLog(url, null, SVNRevision.HEAD, > SVNRevision.parse("1"), SVNRevision.HEAD, false, true, 0, new > ISVNLogEntryHandler() { > public void handleLogEntry(SVNLogEntry arg0) throws > SVNException { > > System.out.println(arg0.getChangedPaths().values()); > SVNLogEntryPath entryPath = (SVNLogEntryPath) > arg0.getChangedPaths().values(); > } > }); > } > > This line: > > SVNLogEntryPath entryPath = (SVNLogEntryPath) > arg0.getChangedPaths().values(); > > does not work: > > org.tmatesoft.svn.core.internal.util.SVNHashMap$ValueCollection cannot be > cast to org.tmatesoft.svn.core.SVNLogEntryPath > java.lang.ClassCastException: > org.tmatesoft.svn.core.internal.util.SVNHashMap$ValueCollection cannot be > cast to org.tmatesoft.svn.core.SVNLogEntryPath > at > org.technisat.checkurl.CheckURL$1.handleLogEntry(CheckURL.java:124) > at > org.tmatesoft.svn.core.wc.SVNLogClient$2.handleLogEntry(SVNLogClient.java:783) > at > org.tmatesoft.svn.core.internal.io.dav.DAVRepository$1.handleLogEntry(DAVRepository.java:597) > > > > How can I create a SVNLogEntryPath object from SVNLogEntry? > > > Many thanks and best regards, > Sandro Frenzel > > > --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
||||||||
|
|
Re: Create SVNLogEntryPath from SVNLogEntryOr better still, use: Map.Entry<String,SVNLogEntryPath>. It's more efficient to iterate over a map using a Map.Entry because it provides both the key and the value together without having to look up the map value by key later.
Hello Sandro, Your casting is invalid and it is what the stack trace reports about. You should iterate over a Map object, like this: for (Iterator pathsIter = arg0.getChangedPaths().keySet().iterator(); pathsIter.hasNext();) { String path = (String) pathsIter.next(); SVNLogEntryPath logEntryPath = (SVNLogEntryPath) arg0.getChangedPaths.get(path); } ---- Alexander Sinyushkin, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! Sandro F wrote: > Hello all, > > a try to access the history from a svn repository directory like this: > > Iterator it = invalidEntrys.iterator(); > while(it.hasNext()) { > SVNURL url = repos.getLocation(); > String entry = (String) it.next(); > String dir = entry.substring(0, > entry.lastIndexOf("/")); > url = url.appendPath(dir, false); > logClient.doLog(url, null, SVNRevision.HEAD, > SVNRevision.parse("1"), SVNRevision.HEAD, false, true, 0, new > ISVNLogEntryHandler() { > public void handleLogEntry(SVNLogEntry arg0) throws > SVNException { > > System.out.println(arg0.getChangedPaths().values()); > SVNLogEntryPath entryPath = (SVNLogEntryPath) > arg0.getChangedPaths().values(); > } > }); > } > > This line: > > SVNLogEntryPath entryPath = (SVNLogEntryPath) > arg0.getChangedPaths().values(); > > does not work: > > org.tmatesoft.svn.core.internal.util.SVNHashMap$ValueCollection cannot be > cast to org.tmatesoft.svn.core.SVNLogEntryPath > java.lang.ClassCastException: > org.tmatesoft.svn.core.internal.util.SVNHashMap$ValueCollection cannot be > cast to org.tmatesoft.svn.core.SVNLogEntryPath > at > org.technisat.checkurl.CheckURL$1.handleLogEntry(CheckURL.java:124) > at > org.tmatesoft.svn.core.wc.SVNLogClient$2.handleLogEntry(SVNLogClient.java:783) > at > org.tmatesoft.svn.core.internal.io.dav.DAVRepository$1.handleLogEntry(DAVRepository.java:597) > > > > How can I create a SVNLogEntryPath object from SVNLogEntry? > > > Many thanks and best regards, > Sandro Frenzel > > > --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... Unless stated otherwise above:
|
| Free embeddable forum powered by Nabble | Forum Help |