Example #1
0
 public long getVersionCount(DocumentName documentName) {
   try {
     PDocument pdocument = getpDocument(documentName);
     return pdocument.getVersionSupport().getVersionInfo().listVersions().size();
   } catch (MDSAccessException e) {
     return 0;
   }
 }
Example #2
0
 public Date getLastModified(DocumentName documentName) {
   try {
     PDocument pdocument = getpDocument(documentName);
     PDocumentVersionSupport versionSupport = pdocument.getVersionSupport();
     VersionInfo versionInfo = versionSupport.getVersionInfo();
     Version version = versionInfo.getVersion();
     return new Date(version.getCreationTime());
   } catch (MDSAccessException e) {
     return new Date();
   }
 }
Example #3
0
 public HashMap<Long, Date> getVersions(DocumentName documentName) {
   HashMap<Long, Date> hashMap = new HashMap<Long, Date>();
   try {
     PDocument pdocument = getpDocument(documentName);
     for (Version v : pdocument.getVersionSupport().getVersionInfo().listVersions()) {
       hashMap.put(v.getVersionNumber(), new Date(v.getCreationTime()));
     }
   } catch (MDSAccessException e) {
     throw new IllegalArgumentException("Could not list Versions !" + e.getMessage());
   }
   return hashMap;
 }