I am creating a document for my company with svnkit and poi it all seems going fairly well, until I stomped into the ‘creation date’ part of the document. I have a bunch of properties that needed to be showing, so far I was able to find it through google. I have read that I can actually retrieve the creation date of any file by doing a SVNRepository.log and looking at the first SVNLogEntry.getDate, but most of my documents revolves around the latest data of revisions. Beeing the last comments, the person who last modified it and such, so I was trying to fill it all with SVNRepository.getLatestRevision. So if there is nothing else available I will have to do a bunch of fors looking for the creation date of each file and looking for which file it corresponds. What I am asking is: Is there any svn property that points directly to the creation date of a file?
A bit of sample code to show what I am doing:
ArrayList<SVNFileRevision> resultReturn new ArrayList<SVNFileRevision>();
ArrayList entries = new ArrayList<SVNDirEntry>();
repository.getDir(path, repository.getLatestRevision(), true, entries);
Iterator iterator = entries.iterator();
while (iterator.hasNext()) {
SVNDirEntry entry = (SVNDirEntry) iterator.next();
if (entry.getKind() != SVNNodeKind.DIR) {
ArrayList<SVNFileRevision> aux = new ArrayList<SVNFileRevision>();
repository.getFileRevisions(path + (path.equals("") ? "" : "/") + entry.getName(), temp, 1,
repository.getLatestRevision());
for (SVNFileRevision rev : aux) {
//So we know that rev contains date author and log
//System.out.println(rev.getRevision());
//System.out.println(rev.getRevisionProperties().getSVNPropertyValue("svn:date"));
//System.out.println(rev.getRevisionProperties().getSVNPropertyValue("svn:author"));
//System.out.println(rev.getRevisionProperties().getSVNPropertyValue("svn:log"));
//we add path and name
rev.getRevisionProperties().put("path", path);
rev.getRevisionProperties().put("name", entry.getName());
//insert creation date
// ? ? ?
resultReturn.add(rev);
}
}
}
return resultReturn;
Thanks in advance for any help.