String[] versions = userRegistry.getVersions(path);
List <VersionPath> versionPaths = new ArrayList <VersionPath> ();
for (String version : versions) {
VersionPath versionPath = new VersionPath();
versionPath.setCompleteVersionPath(version);
versionPath.setActiveResourcePath(path);
ResourcePath resourcePath = new ResourcePath(version);
if (!resourcePath.isCurrentVersion()) {
long versionNumber = Long.parseLong(resourcePath.
getParameterValue(RegistryConstants.VERSION_PARAMETER_NAME));
versionPath.setVersionNumber(versionNumber);
}
Resource versionResource = userRegistry.get(version);
if (versionResource != null) {
versionPath.setUpdater(versionResource.getLastUpdaterUserName());
Calendar versionLastModified = Calendar.getInstance();
versionLastModified.setTime(versionResource.getLastModified());
versionPath.setUpdatedOn(versionLastModified);
versionResource.discard();
}
versionPaths.add(versionPath);
}