@Override public void mkdirs( File fileName ) throws IOException { delegate.mkdirs( fileName ); }
@Override public void rename( File to, CopyOption... options ) throws IOException { File parentFile = file.getParentFile(); File canonicalTarget = to.getCanonicalFile(); fs.mkdirs( canonicalTarget.getParentFile() ); fs.renameFile( file, canonicalTarget, options ); removeEmptyParent( parentFile ); }
private void createDirectory( File databaseDirectory ) { try { fileSystem.mkdirs( databaseDirectory ); } catch ( IOException e ) { throw new UncheckedIOException( "Failed to create directory: " + databaseDirectory, e ); } }
private File existingDirectory( String dir ) throws IOException { File directory = new File( path, dir ); fsa.mkdirs( directory ); return directory; }
@Override protected void mkdirs( File dir ) throws IOException { getFs().mkdirs( dir ); }
@Override public void mkdirs( File fileName ) throws IOException { adversary.injectFailure( SecurityException.class, IOException.class ); delegate.mkdirs( fileName ); }
@Override public void mkdirs( File fileName ) throws IOException { chooseFileSystem( fileName ).mkdirs( fileName ); }
public LogFiles build() throws IOException { TransactionLogFilesContext filesContext = buildContext(); File logsDirectory = getLogsDirectory(); filesContext.getFileSystem().mkdirs( logsDirectory ); return new TransactionLogFiles( logsDirectory, logFileName, filesContext ); }
protected void ensureExists( File file ) throws IOException { fs.mkdirs( file.getParentFile() ); fs.create( file ).close(); }
private File existingFile( String fileName ) throws IOException { File file = new File( path, fileName ); fsa.mkdirs( path ); fsa.create( file ).close(); return file; }
@Test void shouldCreateDeepPath() throws Exception { path = new File( path, UUID.randomUUID() + "/" + UUID.randomUUID() ); fsa.mkdirs( path ); assertTrue( fsa.fileExists( path ) ); }
private static File clean( FileSystemAbstraction fs, File dir ) throws IOException { if ( fs.fileExists( dir ) ) { fs.deleteRecursively( dir ); } fs.mkdirs( dir ); return dir; }
public static void prepareSampleLegacyDatabase( String version, FileSystemAbstraction workingFs, File workingDirectory, File prepareDirectory ) throws IOException { if ( !prepareDirectory.exists() ) { throw new IllegalArgumentException( "bad prepare directory" ); } File resourceDirectory = findFormatStoreDirectoryForVersion( version, prepareDirectory ); workingFs.deleteRecursively( workingDirectory ); workingFs.mkdirs( workingDirectory ); workingFs.copyRecursively( resourceDirectory, workingDirectory ); }
@Before public void createWorkingDirectoryAndTestFile() throws IOException { Thread.interrupted(); fs.mkdirs( testdir.directory() ); file = testdir.file( "a" ); fs.create( file ).close(); channel = null; channelShouldBeClosed = false; Thread.currentThread().interrupt(); }
@Test public void shouldOverwriteInitialPasswordFileIfExists() throws Throwable { // Given fileSystem.mkdirs( authInitFile.getParentFile() ); fileSystem.create( authInitFile ); // When String[] arguments = {"123"}; setPasswordCommand.execute( arguments ); // Then assertAuthIniFile( "123" ); }
@Test void shouldCreatePath() throws Exception { fsa.mkdirs( path ); assertTrue( fsa.fileExists( path ) ); }
@Test void deleteRecursivelyMustDeleteGivenDirectory() throws Exception { fsa.mkdirs( path ); fsa.deleteRecursively( path ); assertFalse( fsa.fileExists( path ) ); }
@Before public void setup() throws IOException, EntityNotFoundException { indexProvider = providerCreator.apply( this ); rules.fileSystem().mkdirs( indexProvider.directoryStructure().rootDirectory() ); populator = indexProvider.getPopulator( descriptor, samplingConfig ); when( nodePropertyAccessor.getNodePropertyValue( anyLong(), anyInt() ) ).thenThrow( UnsupportedOperationException.class ); prevAccessCheck = UnsafeUtil.exchangeNativeAccessCheckEnabled( false ); }
@Test void deleteRecursivelyMustDeleteGivenFile() throws Exception { fsa.mkdirs( path ); File file = new File( path, "file" ); fsa.create( file ).close(); fsa.deleteRecursively( file ); assertFalse( fsa.fileExists( file ) ); }