protected File getLegacyAttributesDirectory() { return applicationConfiguration.getWorkingDirectory( "proxy/attributes", false ); }
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()); } } }
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; }
@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 ); } }
public synchronized File initializeWorkingDirectory() { final File workingDirectory = applicationConfiguration.getWorkingDirectory( "proxy/attributes", false ); if ( workingDirectory.exists() ) { if ( !workingDirectory.isDirectory() ) { throw new IllegalArgumentException( "The attribute storage exists and is not a directory: " + workingDirectory.getAbsolutePath() ); } getLogger().debug( "Legacy Attribute storage directory does exists here \"{}\", legacy AttributeStorage will be used.", workingDirectory ); } else { getLogger().debug( "Legacy Attribute storage directory does not exists, was expecting it here \"{}\", legacy AttributeStorage will not be used.", workingDirectory ); return null; } return workingDirectory; }
private void updateConfiguration() throws IOException { final TimelineConfiguration config = new TimelineConfiguration(applicationConfiguration.getWorkingDirectory(TIMELINE_BASEDIR)); timeline.start(config); }
public void cleanRepositoryFolders( final Repository repository, boolean deleteForever ) throws IOException { File defaultStorageFolder = new File( new File( getApplicationConfiguration().getWorkingDirectory(), "storage" ), repository.getId() ); String defaultStorageURI = defaultStorageFolder.toURI().toURL().toString(); defaultStorageURI = defaultStorageURI.endsWith( "/" ) ? defaultStorageURI : defaultStorageURI + "/"; String localURI = repository.getLocalUrl(); localURI = localURI.endsWith( "/" ) ? localURI : localURI + "/"; boolean defaultLocation = defaultStorageURI.equals( localURI ); // we do this _only_ if storage is not user-customized if ( defaultLocation ) { delete( defaultStorageFolder, deleteForever ); } } }
return new File( applicationConfiguration.getWorkingDirectory( "storage" ), repositoryId );
public void cleanRepositoryFolders(Repository repository, boolean deleteForever) throws IOException { if (repository.getRepositoryKind().isFacetAvailable(ShadowRepository.class)) { return; } File indexContextFolder = new File(getApplicationConfiguration().getWorkingDirectory( DefaultIndexerManager.INDEXER_WORKING_DIRECTORY_KEY), repository.getId() + DefaultIndexerManager.CTX_SUFIX); if (indexContextFolder.isDirectory()) { // indexes are not preserved delete(indexContextFolder, true); } }
new File( getApplicationConfiguration().getWorkingDirectory( GLOBAL_TRASH_KEY ), file.getName() );
scriptDir = applicationConfiguration.getWorkingDirectory( "scripts" ); if ( !scriptDir.exists() )
getApplicationConfiguration().getWorkingDirectory( AbstractRepositoryFolderCleaner.GLOBAL_TRASH_KEY );
File defaultStorageFile = new File( new File( configuration.getWorkingDirectory(), "storage" ), repo.getId() );