Search in sources :

Example 1 with SVNAdminAreaFactory

use of org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory in project intellij-community by JetBrains.

the class SvnKitAdminAreaFactorySelector method factoriesFor15.

private static Collection<SVNAdminAreaFactory> factoriesFor15(final Collection factories) {
    final Collection<SVNAdminAreaFactory> result = new ArrayList<>(2);
    for (Object item : factories) {
        final SVNAdminAreaFactory factory = (SVNAdminAreaFactory) item;
        final int supportedVersion = factory.getSupportedVersion();
        if ((WorkingCopyFormat.ONE_DOT_FOUR.getFormat() == supportedVersion) || (WorkingCopyFormat.ONE_DOT_THREE.getFormat() == supportedVersion) || (WorkingCopyFormat.ONE_DOT_FIVE.getFormat() == supportedVersion)) {
            result.add(factory);
        }
    }
    return result;
}
Also used : SVNAdminAreaFactory(org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory) ArrayList(java.util.ArrayList)

Example 2 with SVNAdminAreaFactory

use of org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory in project intellij-community by JetBrains.

the class SvnKitAdminAreaFactorySelector method factoriesFor14.

private static Collection<SVNAdminAreaFactory> factoriesFor14(final Collection factories) {
    final Collection<SVNAdminAreaFactory> result = new ArrayList<>(2);
    for (Object item : factories) {
        final SVNAdminAreaFactory factory = (SVNAdminAreaFactory) item;
        final int supportedVersion = factory.getSupportedVersion();
        if ((WorkingCopyFormat.ONE_DOT_FOUR.getFormat() == supportedVersion) || (WorkingCopyFormat.ONE_DOT_THREE.getFormat() == supportedVersion)) {
            result.add(factory);
        }
    }
    return result;
}
Also used : SVNAdminAreaFactory(org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory) ArrayList(java.util.ArrayList)

Example 3 with SVNAdminAreaFactory

use of org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory in project intellij-community by JetBrains.

the class SvnKitAdminAreaFactorySelector method factoriesFor16.

private static Collection<SVNAdminAreaFactory> factoriesFor16(final Collection factories) {
    final Collection<SVNAdminAreaFactory> result = new ArrayList<>(2);
    for (Object item : factories) {
        final SVNAdminAreaFactory factory = (SVNAdminAreaFactory) item;
        final int supportedVersion = factory.getSupportedVersion();
        if ((WorkingCopyFormat.ONE_DOT_FOUR.getFormat() == supportedVersion) || (WorkingCopyFormat.ONE_DOT_THREE.getFormat() == supportedVersion) || (WorkingCopyFormat.ONE_DOT_FIVE.getFormat() == supportedVersion) || (WorkingCopyFormat.ONE_DOT_SIX.getFormat() == supportedVersion)) {
            result.add(factory);
        }
    }
    return result;
}
Also used : SVNAdminAreaFactory(org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory) ArrayList(java.util.ArrayList)

Example 4 with SVNAdminAreaFactory

use of org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory in project intellij-community by JetBrains.

the class SvnKitAdminAreaFactorySelector method factoriesFor13.

private static Collection<SVNAdminAreaFactory> factoriesFor13(final Collection factories) {
    for (Object item : factories) {
        final SVNAdminAreaFactory factory = (SVNAdminAreaFactory) item;
        final int supportedVersion = factory.getSupportedVersion();
        if (WorkingCopyFormat.ONE_DOT_THREE.getFormat() == supportedVersion) {
            return Collections.singletonList(factory);
        }
    }
    return Collections.emptyList();
}
Also used : SVNAdminAreaFactory(org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory)

Example 5 with SVNAdminAreaFactory

use of org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory 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

SVNAdminAreaFactory (org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory)5 ArrayList (java.util.ArrayList)3 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