Search in sources :

Example 1 with ISVNAdminAreaFactorySelector

use of org.tmatesoft.svn.core.internal.wc.admin.ISVNAdminAreaFactorySelector in project oxTrust by GluuFederation.

the class SubversionService method initSubversionService.

/*
	 * Initialize singleton instance during startup
	 */
public void initSubversionService() {
    String svnConfigurationStoreRoot = null;
    if (appConfiguration.isPersistSVN()) {
        svnConfigurationStoreRoot = appConfiguration.getSvnConfigurationStoreRoot();
    }
    SVNAdminAreaFactory.setSelector(new ISVNAdminAreaFactorySelector() {

        @SuppressWarnings({ "unchecked", "rawtypes" })
        public Collection getEnabledFactories(File path, Collection factories, boolean writeAccess) throws SVNException {
            Collection enabledFactories = new TreeSet();
            for (Iterator factoriesIter = factories.iterator(); factoriesIter.hasNext(); ) {
                SVNAdminAreaFactory factory = (SVNAdminAreaFactory) factoriesIter.next();
                int version = factory.getSupportedVersion();
                if (version == SVNAdminAreaFactory.WC_FORMAT_16) {
                    enabledFactories.add(factory);
                }
            }
            return enabledFactories;
        }
    });
    if (StringHelper.isEmpty(svnConfigurationStoreRoot)) {
        log.warn("The service which commit configuration files into SVN was disabled");
        return;
    }
    SvnHelper.setupLibrary(svnConfigurationStoreRoot);
}
Also used : SVNAdminAreaFactory(org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory) TreeSet(java.util.TreeSet) Iterator(java.util.Iterator) ISVNAdminAreaFactorySelector(org.tmatesoft.svn.core.internal.wc.admin.ISVNAdminAreaFactorySelector) Collection(java.util.Collection) SVNException(org.tmatesoft.svn.core.SVNException) SubversionFile(org.gluu.oxtrust.model.SubversionFile) File(java.io.File)

Aggregations

File (java.io.File)1 Collection (java.util.Collection)1 Iterator (java.util.Iterator)1 TreeSet (java.util.TreeSet)1 SubversionFile (org.gluu.oxtrust.model.SubversionFile)1 SVNException (org.tmatesoft.svn.core.SVNException)1 ISVNAdminAreaFactorySelector (org.tmatesoft.svn.core.internal.wc.admin.ISVNAdminAreaFactorySelector)1 SVNAdminAreaFactory (org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory)1