Package io.micronaut.objectstorage.local
Class LocalStorageOperations
java.lang.Object
io.micronaut.objectstorage.local.LocalStorageOperations
- All Implemented Interfaces:
- ObjectStorageOperations<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,- io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile, - io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> 
@EachBean(LocalStorageConfiguration.class)
@Requires(condition=ToggeableCondition.class) @Requires(beans=LocalStorageConfiguration.class)
@Primary
public class LocalStorageOperations
extends Object
implements ObjectStorageOperations<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile>  
An implementation of 
ObjectStorageOperations that uses the local file system. Useful for
 testing.- Since:
- 2.0.0
- Author:
- Álvaro Sánchez-Mariscal
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidCopies an object stored atsourceKeytodestinationKey, within the same object storage (bucket/container).@NonNull io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFileDeletes an object from the object storage.booleanChecks whether an entry with the given key exists in the object storage.Lists the objects that exist in the object storage.@NonNull Optional<LocalStorageEntry>Gets the object from object storage.@NonNull UploadResponse<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile>upload(@NonNull UploadRequest request) Uploads an object to the object storage.@NonNull UploadResponse<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile>upload(@NonNull UploadRequest request, @NonNull Consumer<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> requestConsumer) Uploads an object to the object storage.
- 
Field Details- 
METADATA_DIRECTORY- See Also:
 
 
- 
- 
Constructor Details- 
LocalStorageOperations
 
- 
- 
Method Details- 
upload@NonNull public @NonNull UploadResponse<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> upload(@NonNull @NonNull UploadRequest request) Description copied from interface:ObjectStorageOperationsUploads an object to the object storage. If there is an existing entry, it will be updated.- Specified by:
- uploadin interface- ObjectStorageOperations<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,- io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile, - io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> 
- Parameters:
- request- the upload request
- Returns:
- the upload response
 
- 
upload@NonNull public @NonNull UploadResponse<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> upload(@NonNull @NonNull UploadRequest request, @NonNull @NonNull Consumer<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> requestConsumer) Description copied from interface:ObjectStorageOperationsUploads an object to the object storage. If there is an existing entry, it will be updated.- Specified by:
- uploadin interface- ObjectStorageOperations<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,- io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile, - io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> 
- Parameters:
- request- the upload request
- requestConsumer- Upload request builder consumer
- Returns:
- the upload response
 
- 
retrieveDescription copied from interface:ObjectStorageOperationsGets the object from object storage.- Specified by:
- retrievein interface- ObjectStorageOperations<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,- io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile, - io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> 
- Parameters:
- key- the object path in the format- /foo/bar/file
- Returns:
- the object, or empty optional if the object does not exist
 
- 
delete@NonNull public @NonNull io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile delete(@NonNull @NonNull String key) Description copied from interface:ObjectStorageOperationsDeletes an object from the object storage.- Specified by:
- deletein interface- ObjectStorageOperations<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,- io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile, - io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> 
- Parameters:
- key- object path in the format- /foo/bar/file
- Returns:
- Cloud vendor-specific delete response.
 
- 
existsDescription copied from interface:ObjectStorageOperationsChecks whether an entry with the given key exists in the object storage.- Specified by:
- existsin interface- ObjectStorageOperations<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,- io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile, - io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> 
- Parameters:
- key- object path in the format- /foo/bar/file
- Returns:
- true if the entry exists, false otherwise.
 
- 
listObjectsDescription copied from interface:ObjectStorageOperationsLists the objects that exist in the object storage.- Specified by:
- listObjectsin interface- ObjectStorageOperations<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,- io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile, - io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> 
- Returns:
- a list of keys (paths) of the existing objects, if any, or an empty list otherwise.
 
- 
copyDescription copied from interface:ObjectStorageOperationsCopies an object stored atsourceKeytodestinationKey, within the same object storage (bucket/container). If the destination exists, it will be overwritten.- Specified by:
- copyin interface- ObjectStorageOperations<io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile,- io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile, - io.micronaut.objectstorage.local.LocalStorageOperations.LocalStorageFile> 
- Parameters:
- sourceKey- the key of the source object
- destinationKey- the key of the destination object
 
 
-