private void deleteNativeIndexFile( DatabaseLayout directoryStructure ) throws IOException { Optional<FileHandle> indexFile = fileSystem.streamFilesRecursive( NativeLabelScanStore.getLabelScanStoreFile( directoryStructure ) ).findFirst(); if ( indexFile.isPresent() ) { try { indexFile.get().delete(); } catch ( NoSuchFileException e ) { // Already deleted, ignore } } }
private void deleteNativeIndexFile( DatabaseLayout directoryStructure ) throws IOException { Optional<FileHandle> indexFile = fileSystem.streamFilesRecursive( NativeLabelScanStore.getLabelScanStoreFile( directoryStructure ) ).findFirst(); if ( indexFile.isPresent() ) { try { indexFile.get().delete(); } catch ( NoSuchFileException e ) { // Already deleted, ignore } } }
public void delete( File storeDir, LogFiles logFiles ) throws IOException { // 'files' can be null if the directory doesn't exist. This is fine, we just ignore it then. File[] files = fs.listFiles( storeDir, fileFilter ); if ( files != null ) { for ( File file : files ) { fs.deleteRecursively( file ); } } File[] txLogs = fs.listFiles( logFiles.logFilesDirectory() ); if ( txLogs != null ) { for ( File txLog : txLogs ) { fs.deleteFile( txLog ); } } Iterable<FileHandle> iterator = acceptedPageCachedFiles( storeDir )::iterator; for ( FileHandle fh : iterator ) { fh.delete(); } }