@Test public void getAsset() { StorageAsset asset = fsStorage.getAsset("/dir1/testfile1.dat"); Assert.assertEquals(file1, asset.getFilePath()); }
@Override public StorageAsset getAsset( String path ) { try { return new FilesystemAsset(this, path, getAssetPath(path), basePath); } catch (IOException e) { throw new IllegalArgumentException("Path navigates outside of base directory "+path); } }
FilesystemStorage implements RepositoryStorage { @Override public StorageAsset getAsset( String path ) { try { return new FilesystemAsset(this, path, getAssetPath(path), basePath); } catch (IOException e) { throw new IllegalArgumentException("Path navigates outside of base directory "+path); } } }
FilesystemStorage implements RepositoryStorage { @Override public StorageAsset getAsset( String path ) { try { return new FilesystemAsset(this, path, getAssetPath(path), basePath); } catch (IOException e) { throw new IllegalArgumentException("Path navigates outside of base directory "+path); } } FilesystemStorage(Path basePath, FileLockManager fileLockManager); }
FilesystemStorage implements RepositoryStorage { @Override public StorageAsset getAsset( String path ) { try { return new FilesystemAsset(this, path, getAssetPath(path), basePath); } catch (IOException e) { throw new IllegalArgumentException("Path navigates outside of base directory "+path); } } FilesystemStorage(Path basePath, FileLockManager fileLockManager); @Override void consumeData( StorageAsset asset, Consumer<InputStream> consumerFunction, boolean readLock ); @Override void consumeDataFromChannel( StorageAsset asset, Consumer<ReadableByteChannel> consumerFunction, boolean readLock ); @Override void writeData( StorageAsset asset, Consumer<OutputStream> consumerFunction, boolean writeLock ); @Override void writeDataToChannel( StorageAsset asset, Consumer<WritableByteChannel> consumerFunction, boolean writeLock ); @Override URI getLocation(); @Override void updateLocation(URI newLocation); @Override StorageAsset getAsset( String path ); @Override StorageAsset getRoot( ); @Override StorageAsset addAsset( String path, boolean container ); @Override void removeAsset( StorageAsset asset ); @Override StorageAsset moveAsset( StorageAsset origin, String destination, CopyOption... copyOptions ); @Override void moveAsset( StorageAsset origin, StorageAsset destination, CopyOption... copyOptions ); @Override StorageAsset copyAsset( StorageAsset origin, String destination, CopyOption... copyOptions ); @Override void copyAsset( StorageAsset origin, StorageAsset destination, CopyOption... copyOptions ); FileLockManager getFileLockManager(); }
FilesystemStorage implements RepositoryStorage { @Override public StorageAsset getAsset( String path ) { try { return new FilesystemAsset(this, path, getAssetPath(path), basePath); } catch (IOException e) { throw new IllegalArgumentException("Path navigates outside of base directory "+path); } } FilesystemStorage(Path basePath, FileLockManager fileLockManager); @Override void consumeData( StorageAsset asset, Consumer<InputStream> consumerFunction, boolean readLock ); @Override void consumeDataFromChannel( StorageAsset asset, Consumer<ReadableByteChannel> consumerFunction, boolean readLock ); @Override void writeData( StorageAsset asset, Consumer<OutputStream> consumerFunction, boolean writeLock ); @Override void writeDataToChannel( StorageAsset asset, Consumer<WritableByteChannel> consumerFunction, boolean writeLock ); @Override URI getLocation(); @Override void updateLocation(URI newLocation); @Override StorageAsset getAsset( String path ); @Override StorageAsset getRoot( ); @Override StorageAsset addAsset( String path, boolean container ); @Override void removeAsset( StorageAsset asset ); @Override StorageAsset moveAsset( StorageAsset origin, String destination, CopyOption... copyOptions ); @Override void moveAsset( StorageAsset origin, StorageAsset destination, CopyOption... copyOptions ); @Override StorageAsset copyAsset( StorageAsset origin, String destination, CopyOption... copyOptions ); @Override void copyAsset( StorageAsset origin, StorageAsset destination, CopyOption... copyOptions ); FileLockManager getFileLockManager();  }