@Test void testDelete() throws IOException { MockAsset root = createTree( ); MockStorage storage = new MockStorage( root ); StorageUtil.deleteRecursively( root ); int expected = LEVEL1 * LEVEL2 * LEVEL3 + LEVEL1 * LEVEL2 + LEVEL1 + 1; assertEquals( expected, storage.getStatus( ).size( MockStorage.REMOVE ) ); }
public static final void deleteRecursively(StorageAsset baseDir) { RepositoryStorage storage = baseDir.getStorage( ); walk( baseDir, a -> { try { storage.removeAsset(a); } catch (IOException e) { LOG.error( "Could not delete asset {}: {}", a.getPath( ), e.getMessage( ), e ); } }); }
StorageUtil { public static final void deleteRecursively(StorageAsset baseDir) { RepositoryStorage storage = baseDir.getStorage( ); walk( baseDir, a -> { try { storage.removeAsset(a); } catch (IOException e) { LOG.error( "Could not delete asset {}: {}", a.getPath( ), e.getMessage( ), e ); } }); } }
StorageUtil { public static final void deleteRecursively(StorageAsset baseDir) { RepositoryStorage storage = baseDir.getStorage( ); walk( baseDir, a -> { try { storage.removeAsset(a); } catch (IOException e) { LOG.error( "Could not delete asset {}: {}", a.getPath( ), e.getMessage( ), e ); } }); }  }
StorageUtil { public static final void deleteRecursively(StorageAsset baseDir) { RepositoryStorage storage = baseDir.getStorage( ); walk( baseDir, a -> { try { storage.removeAsset(a); } catch (IOException e) { LOG.error( "Could not delete asset {}: {}", a.getPath( ), e.getMessage( ), e ); } }); }  static void walk( StorageAsset start, Consumer<StorageAsset> consumer ); static void walk( StorageAsset start, Function<StorageAsset, Boolean> consumer ); static Stream<StorageAsset> newAssetStream( StorageAsset start, boolean parallel ); static Stream<StorageAsset> newAssetStream( StorageAsset start); static final void deleteRecursively(StorageAsset baseDir); static final boolean deleteRecursively(final StorageAsset baseDir, final boolean stopOnError); static final void moveAsset(StorageAsset source, StorageAsset target, boolean locked, CopyOption... copyOptions); static final void copy( final ReadableByteChannel is, final WritableByteChannel os ); static final void copy( final FileChannel is, final WritableByteChannel os ); static final void copy( final ReadableByteChannel is, final FileChannel os ); static final String getExtension(StorageAsset asset); }
StorageUtil { public static final void deleteRecursively(StorageAsset baseDir) { RepositoryStorage storage = baseDir.getStorage( ); walk( baseDir, a -> { try { storage.removeAsset(a); } catch (IOException e) { LOG.error( "Could not delete asset {}: {}", a.getPath( ), e.getMessage( ), e ); } }); }  static void walk( StorageAsset start, Consumer<StorageAsset> consumer ); static void walk( StorageAsset start, Function<StorageAsset, Boolean> consumer ); static Stream<StorageAsset> newAssetStream( StorageAsset start, boolean parallel ); static Stream<StorageAsset> newAssetStream( StorageAsset start); static final void deleteRecursively(StorageAsset baseDir); static final boolean deleteRecursively(final StorageAsset baseDir, final boolean stopOnError); static final void moveAsset(StorageAsset source, StorageAsset target, boolean locked, CopyOption... copyOptions); static final void copy( final ReadableByteChannel is, final WritableByteChannel os ); static final void copy( final FileChannel is, final WritableByteChannel os ); static final void copy( final ReadableByteChannel is, final FileChannel os ); static final String getExtension(StorageAsset asset);  }