protected File getLegacyAttributesDirectory() { return applicationConfiguration.getWorkingDirectory( "proxy/attributes", false ); }
@Override public boolean isParticipating( final IssueSubmissionRequest issueSubmissionRequest ) { // file is created if ldap realm is activated return new File( cfg.getConfigurationDirectory(), "ldap.xml" ).exists(); }
public LocalStorageContext getLocalStorageContext() { if ( localStorageContext == null ) { localStorageContext = new DefaultLocalStorageContext( getApplicationConfiguration().getGlobalLocalStorageContext() ); } return localStorageContext; }
@Override protected void initializeConfiguration() throws ConfigurationException { if ( getApplicationConfiguration().getConfigurationModel() != null ) { configure( getApplicationConfiguration() ); } }
@Override public void mirror(final boolean force) { if (force) { overwriteRemoteUrl = null; } try { mirrorUpdateSite(force); setExposed(true); getApplicationConfiguration().saveConfiguration(); } catch (final Exception e) { log.error("Could not mirror Eclipse Update Site", e); } }
public RemoteStorageContext getRemoteStorageContext() { if ( remoteStorageContext == null ) { remoteStorageContext = new DefaultRemoteStorageContext( getApplicationConfiguration().getGlobalRemoteStorageContext() ); } return remoteStorageContext; }
@Override protected void initializeConfiguration() throws ConfigurationException { if ( getApplicationConfiguration().getConfigurationModel() != null ) { configure( getApplicationConfiguration() ); } }
applicationConfiguration.saveConfiguration();
@Override public DefaultHttpClient createHttpClient() { final DefaultHttpClient result = createHttpClient( applicationConfiguration.getGlobalRemoteStorageContext() ); // connection manager will cap the max count of connections, but with this below // we get rid of pooling. Pooling is used in Proxy repositories only, as all other // components using the "shared" httpClient should not produce hiw rate of requests // anyway, as they usually happen per user interactions (GPG gets keys are staging repo is closed, if not cached // yet, LVO gets info when UI's main window is loaded into user's browser, etc result.setReuseStrategy( new NoConnectionReuseStrategy() ); return result; }
public synchronized File initializeWorkingDirectory() { final File workingDirectory = applicationConfiguration.getWorkingDirectory( "proxy/attributes-ng" ); if ( workingDirectory.exists() ) { if ( !workingDirectory.isDirectory() ) { throw new IllegalArgumentException( "The attribute storage exists and is not a directory: " + workingDirectory.getAbsolutePath() ); } } else { getLogger().info( "Attribute storage directory does not exists, creating it here: " + workingDirectory ); if ( !workingDirectory.mkdirs() ) { if ( !workingDirectory.isDirectory() ) { throw new IllegalArgumentException( "Could not create the attribute storage directory on path " + workingDirectory.getAbsolutePath() ); } } } return workingDirectory; }
protected void initializeConfiguration() throws ConfigurationException { if ( getApplicationConfiguration().getConfigurationModel() != null ) { configure( getApplicationConfiguration() ); } }
@Inject public DefaultKenaiRealmConfiguration(final ApplicationConfiguration applicationConfiguration, final SecuritySystem securitySystem) throws IOException { this.configurationFile = new File(applicationConfiguration.getConfigurationDirectory(), "kenai-realm.xml"); this.securitySystem = securitySystem; this.kenaiRealmModelReader = new KenaiRealmModelReader(); }
@Override public synchronized AsyncHttpClient getAsyncHttpClient() { if ( shutdown ) { throw new IllegalStateException( "AHC provider was shut down, not serving client up anymore." ); } if ( sharedClient == null ) { // TODO: nexus wide singleton or new instance per invocation? final Builder configBuilder = getAsyncHttpClientConfigBuilder( applicationConfiguration.getGlobalRemoteStorageContext() ); configBuilder.setUserAgent( userAgentBuilder.formatGenericUserAgentString() ); sharedClient = new AsyncHttpClient( configBuilder.build() ); } return sharedClient; }
@Override public void cleanRepositoryFolders( Repository repository, boolean deleteForever ) throws IOException { File defaultProxyAttributesFolder = new File( new File( getApplicationConfiguration().getWorkingDirectory(), "proxy/attributes" ), repository.getId() ); if ( defaultProxyAttributesFolder.isDirectory() ) { // attributes are not preserved delete( defaultProxyAttributesFolder, true ); } }
@Override protected void initializeConfiguration() throws ConfigurationException { if ( getApplicationConfiguration().getConfigurationModel() != null ) { configure( getApplicationConfiguration() ); } }
public AbstractLdapConfiguration(ApplicationConfiguration applicationConfiguration, ConfigurationValidator validator, PasswordHelper passwordHelper) throws IOException { checkNotNull(applicationConfiguration); this.validator = checkNotNull(validator); this.passwordHelper = checkNotNull(passwordHelper); this.configurationFile = new File(applicationConfiguration.getConfigurationDirectory(), "ldap.xml"); this.ldapModelReader = new LdapModelReader(); this.ldapModelWriter = new LdapModelWriter(); this.configuration = load(); }
private void moveLegacyTimeline() throws IOException { File timelineDir = applicationConfiguration.getWorkingDirectory(TIMELINE_BASEDIR); File legacyIndexDir = timelineDir; File newIndexDir = new File(timelineDir, "index"); File[] legacyIndexFiles = legacyIndexDir.listFiles(new FileFilter() { public boolean accept(File file) { return file.isFile(); } }); if (legacyIndexFiles == null || legacyIndexFiles.length == 0) { return; } if (newIndexDir.exists() && newIndexDir.listFiles().length > 0) { return; } log.info( "Moving legacy timeline index from '" + legacyIndexDir.getAbsolutePath() + "' to '" + newIndexDir.getAbsolutePath() + "'."); DirSupport.mkdir(newIndexDir.toPath()); for (File legacyIndexFile : legacyIndexFiles) { // legacy was just plain Lucene index (so, we move lucene files from here into a SUBDIRECTORY) if (Files.isRegularFile(legacyIndexFile.toPath())) { Files.move(legacyIndexFile.toPath(), new File(newIndexDir, legacyIndexFile.getName()).toPath()); } } }
@Override protected void initializeConfiguration() throws ConfigurationException { if ( getApplicationConfiguration().getConfigurationModel() != null ) { configure( getApplicationConfiguration() ); } }
private void updateConfiguration() throws IOException { final TimelineConfiguration config = new TimelineConfiguration(applicationConfiguration.getWorkingDirectory(TIMELINE_BASEDIR)); timeline.start(config); }
@Override protected void initializeConfiguration() throws ConfigurationException { if ( getApplicationConfiguration().getConfigurationModel() != null ) { configure( getApplicationConfiguration() ); } }