public interface RepositoryStorage
| Modifier and Type | Method and Description |
|---|---|
StorageAsset |
addAsset(String path,
boolean container)
Adds a new asset to the underlying storage.
|
void |
consumeData(StorageAsset asset,
Consumer<InputStream> consumerFunction,
boolean readLock)
Consumes the data and sets a lock for the file during the operation.
|
void |
consumeDataFromChannel(StorageAsset asset,
Consumer<ReadableByteChannel> consumerFunction,
boolean readLock)
Consumes the data and sets a lock for the file during the operation.
|
void |
copyAsset(StorageAsset origin,
StorageAsset destination,
CopyOption... copyOptions)
Copies the given asset to the new destination.
|
StorageAsset |
copyAsset(StorageAsset origin,
String destination,
CopyOption... copyOptions)
Copies the given asset to the new destination.
|
StorageAsset |
getAsset(String path)
Returns information about a specific storage asset.
|
URI |
getLocation()
Returns a URI representation of the storage location.
|
void |
moveAsset(StorageAsset origin,
StorageAsset destination,
CopyOption... copyOptions)
Moves the asset to the given location and returns the asset object for the destination.
|
StorageAsset |
moveAsset(StorageAsset origin,
String destination,
CopyOption... copyOptions)
Moves the asset to the given location and returns the asset object for the destination.
|
void |
removeAsset(StorageAsset asset)
Removes the given asset from the storage.
|
void |
updateLocation(URI newLocation)
Updates the base location of the repository storage.
|
void |
writeData(StorageAsset asset,
Consumer<OutputStream> consumerFunction,
boolean writeLock)
Writes data to the asset using a write lock.
|
void |
writeDataToChannel(StorageAsset asset,
Consumer<WritableByteChannel> consumerFunction,
boolean writeLock)
Writes data and sets a lock during the operation.
|
URI getLocation()
void updateLocation(URI newLocation) throws IOException
newLocation - The URI to the new locationIOException - If the repository cannot be relocatedStorageAsset getAsset(String path)
path - void consumeData(StorageAsset asset, Consumer<InputStream> consumerFunction, boolean readLock) throws IOException
asset - The asset from which the data is consumed.consumerFunction - The consumer that reads the datareadLock - If true, a read lock is acquired on the asset.IOExceptionvoid consumeDataFromChannel(StorageAsset asset, Consumer<ReadableByteChannel> consumerFunction, boolean readLock) throws IOException
asset - The asset from which the data is consumed.consumerFunction - The consumer that reads the datareadLock - If true, a read lock is acquired on the asset.IOExceptionvoid writeData(StorageAsset asset, Consumer<OutputStream> consumerFunction, boolean writeLock) throws IOException
asset - The asset to which the data is written.consumerFunction - The function that provides the data.writeLock - If true, a write lock is acquired on the destination.IOExceptionvoid writeDataToChannel(StorageAsset asset, Consumer<WritableByteChannel> consumerFunction, boolean writeLock) throws IOException
asset - The asset to which the data is written.consumerFunction - The function that provides the data.writeLock - If true, a write lock is acquired on the destination.IOExceptionStorageAsset addAsset(String path, boolean container)
path - The path to the asset.container - True, if the asset should be a container, false, if it is a file.void removeAsset(StorageAsset asset) throws IOException
asset - IOExceptionStorageAsset moveAsset(StorageAsset origin, String destination, CopyOption... copyOptions) throws IOException
origin - The original assetdestination - The destination path pointing to the new asset.copyOptions - The copy options.IOExceptionvoid moveAsset(StorageAsset origin, StorageAsset destination, CopyOption... copyOptions) throws IOException
origin - The original assetdestination - The destination path.copyOptions - The copy options (e.g. StandardCopyOption.REPLACE_EXISTINGIOException - If it was not possible to copy the asset.StorageAsset copyAsset(StorageAsset origin, String destination, CopyOption... copyOptions) throws IOException
origin - The original assetdestination - The path to the new assetcopyOptions - The copy options, e.g. (e.g. StandardCopyOption.REPLACE_EXISTINGIOException - If it was not possible to copy the assetvoid copyAsset(StorageAsset origin, StorageAsset destination, CopyOption... copyOptions) throws IOException
origin - The original assetdestination - The path to the new assetcopyOptions - The copy options, e.g. (e.g. StandardCopyOption.REPLACE_EXISTINGIOException - If it was not possible to copy the assetCopyright © 2006–2019 The Apache Software Foundation. All rights reserved.