Package org.bremersee.minio
Class MinioRepositoryImpl
java.lang.Object
org.bremersee.minio.MinioRepositoryImpl
- All Implemented Interfaces:
MinioRepository
The minio repository implementation.
- Author:
- Christian Bremer
-
Constructor Summary
ConstructorsConstructorDescriptionMinioRepositoryImpl(io.minio.MinioClient minioClient, String region, String bucket, boolean enableVersioning, boolean create, Duration presignedObjectUrlDuration) Instantiates a new minio repository.MinioRepositoryImpl(MinioOperations minioOperations, String region, String bucket, boolean enableVersioning, boolean create, Duration presignedObjectUrlDuration) Instantiates a new minio repository. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(MinioObjectId id) Delete.List<io.minio.messages.DeleteError> deleteAll(Collection<MinioObjectId> ids) Delete all objects.booleanexists(MinioObjectId id) Checks whether an object with the specified name exists or not.Find all objects.findOne(MinioObjectId id) Find one.Gets minio operations.getPresignedObjectUrl(MinioObjectId id, io.minio.http.Method method, Duration duration) Gets presigned object url.booleanIs versioning enabled boolean.Optional<io.minio.ObjectWriteResponse> save(MinioObjectId id, org.springframework.web.multipart.MultipartFile multipartFile, DeleteMode deleteMode) Save multipart file.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bremersee.minio.MinioRepository
findAll, getBucket, getPresignedObjectUrl, getRegion
-
Constructor Details
-
MinioRepositoryImpl
public MinioRepositoryImpl(MinioOperations minioOperations, String region, String bucket, boolean enableVersioning, boolean create, Duration presignedObjectUrlDuration) Instantiates a new minio repository.- Parameters:
minioOperations- the minio operationsregion- the regionbucket- the bucketenableVersioning- the enable versioningcreate- the createpresignedObjectUrlDuration- the presigned object url duration
-
MinioRepositoryImpl
public MinioRepositoryImpl(io.minio.MinioClient minioClient, String region, String bucket, boolean enableVersioning, boolean create, Duration presignedObjectUrlDuration) Instantiates a new minio repository.- Parameters:
minioClient- the minio clientregion- the regionbucket- the bucketenableVersioning- the enable versioningcreate- the createpresignedObjectUrlDuration- the presigned object url duration
-
-
Method Details
-
getMinioOperations
Description copied from interface:MinioRepositoryGets minio operations.- Specified by:
getMinioOperationsin interfaceMinioRepository- Returns:
- the minio operations
-
isVersioningEnabled
public boolean isVersioningEnabled()Description copied from interface:MinioRepositoryIs versioning enabled boolean.- Specified by:
isVersioningEnabledin interfaceMinioRepository- Returns:
- the boolean
-
save
public Optional<io.minio.ObjectWriteResponse> save(MinioObjectId id, org.springframework.web.multipart.MultipartFile multipartFile, DeleteMode deleteMode) Description copied from interface:MinioRepositorySave multipart file.- Specified by:
savein interfaceMinioRepository- Parameters:
id- the idmultipartFile- the multipart filedeleteMode- the delete mode- Returns:
- the write response; will be empty, if the multipart file is
nullor empty
-
exists
Description copied from interface:MinioRepositoryChecks whether an object with the specified name exists or not.- Specified by:
existsin interfaceMinioRepository- Parameters:
id- the id- Returns:
trueif the object exists, otherwisefalse
-
findOne
Description copied from interface:MinioRepositoryFind one.- Specified by:
findOnein interfaceMinioRepository- Parameters:
id- the id- Returns:
- the multipart file
-
findAll
Description copied from interface:MinioRepositoryFind all objects.- Specified by:
findAllin interfaceMinioRepository- Parameters:
prefix- the prefix- Returns:
- the list
-
delete
Description copied from interface:MinioRepositoryDelete.- Specified by:
deletein interfaceMinioRepository- Parameters:
id- the id
-
deleteAll
Description copied from interface:MinioRepositoryDelete all objects.- Specified by:
deleteAllin interfaceMinioRepository- Parameters:
ids- the IDs- Returns:
- the list
-
getPresignedObjectUrl
public String getPresignedObjectUrl(MinioObjectId id, io.minio.http.Method method, Duration duration) Description copied from interface:MinioRepositoryGets presigned object url.- Specified by:
getPresignedObjectUrlin interfaceMinioRepository- Parameters:
id- the idmethod- the methodduration- the duration- Returns:
- the presigned object url
-