VersionFile file = new VersionFile();
file.save(versionFile, user);
}
private void initVersionDir(IDesignerUser user, String timeStamp) throws IOException {
IStorage commentingDir = user.getCommentingDirectory();
IStorage versionDir = commentingDir.newInstance(commentingDir, "snapshot/" + timeStamp);
if(versionDir.exists()) {
return;
}
versionDir.mkdir();
IStorage userDir = user.getUserDirectory();
IStorage[] files = userDir.listFiles();
for (int i = 0; i < files.length; i++) {
String path = files[i].getAbsolutePath();
if (files[i].isFile()
&& path.indexOf(IDavinciServerConstants.WORKING_COPY_EXTENSION) < 0) {
IStorage destination = versionDir.newInstance(files[i].getName());
copyFile(files[i], destination);
} else if (files[i].isDirectory()
// && path.indexOf(IDavinciServerConstants.SETTINGS_DIRECTORY_NAME) < 0 // Need to copy the settings
&& path.indexOf(IDavinciServerConstants.DOWNLOAD_DIRECTORY_NAME) < 0
&& path.indexOf(Constants.REVIEW_DIRECTORY_NAME) < 0
&& path.indexOf(".svn") < 0
&& containsPublishedFiles(files[i], user, timeStamp)) {
IStorage destination = versionDir.newInstance(versionDir, files[i].getName());
copyDirectory(files[i], destination);
}
}
}