Search in sources :

Example 6 with SubversionFile

use of org.gluu.oxtrust.model.SubversionFile in project oxTrust by GluuFederation.

the class SubversionService method getDifferentFiles.

public List<SubversionFile> getDifferentFiles(List<SubversionFile> files) throws IOException {
    String inumFN = StringHelper.removePunctuation(appConfiguration.getApplianceInum());
    String applianceSvnHomePath = String.format("%s/%s", baseSvnDir, inumFN);
    File dir = new File(applianceSvnHomePath);
    log.debug("Copying files to temporary repository folder");
    String dirFn = dir.getAbsolutePath();
    List<SubversionFile> differentFiles = new ArrayList<SubversionFile>();
    for (SubversionFile subversionFile : files) {
        String fn = getLocalRepositoryFilePath(dirFn, subversionFile);
        File f = new File(fn);
        File persistedFile = new File(subversionFile.getLocalFile());
        if ((!f.exists()) || FileUtils.checksumCRC32(persistedFile) != FileUtils.checksumCRC32(f)) {
            differentFiles.add(subversionFile);
        }
    }
    return differentFiles;
}
Also used : ArrayList(java.util.ArrayList) SubversionFile(org.gluu.oxtrust.model.SubversionFile) SubversionFile(org.gluu.oxtrust.model.SubversionFile) File(java.io.File)

Aggregations

SubversionFile (org.gluu.oxtrust.model.SubversionFile)6 File (java.io.File)4 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)3 GluuSAMLTrustRelationship (org.gluu.oxtrust.model.GluuSAMLTrustRelationship)2 SVNException (org.tmatesoft.svn.core.SVNException)1 SVNURL (org.tmatesoft.svn.core.SVNURL)1 SVNClientManager (org.tmatesoft.svn.core.wc.SVNClientManager)1 InvalidConfigurationException (org.xdi.util.exception.InvalidConfigurationException)1