Package org.bremersee.data.minio
Class MinioRepositoryImpl
- java.lang.Object
-
- org.bremersee.data.minio.MinioRepositoryImpl
-
- All Implemented Interfaces:
MinioRepository
public class MinioRepositoryImpl extends Object implements MinioRepository
The minio repository implementation.- Author:
- Christian Bremer
-
-
Constructor Summary
Constructors Constructor Description MinioRepositoryImpl(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(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.List<MinioMultipartFile>findAll(String prefix)Find all objects.Optional<MinioMultipartFile>findOne(MinioObjectId id)Find one.MinioOperationsgetMinioOperations()Gets minio operations.StringgetPresignedObjectUrl(MinioObjectId id, io.minio.http.Method method, Duration duration)Gets presigned object url.booleanisVersioningEnabled()Is 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, wait
-
Methods inherited from interface org.bremersee.data.minio.MinioRepository
findAll, getBucket, getPresignedObjectUrl, getRegion
-
-
-
-
Constructor Detail
-
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 Detail
-
getMinioOperations
public MinioOperations 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
public boolean exists(MinioObjectId id)
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
public Optional<MinioMultipartFile> findOne(MinioObjectId id)
Description copied from interface:MinioRepositoryFind one.- Specified by:
findOnein interfaceMinioRepository- Parameters:
id- the id- Returns:
- the multipart file
-
findAll
public List<MinioMultipartFile> findAll(String prefix)
Description copied from interface:MinioRepositoryFind all objects.- Specified by:
findAllin interfaceMinioRepository- Parameters:
prefix- the prefix- Returns:
- the list
-
delete
public void delete(MinioObjectId id)
Description copied from interface:MinioRepositoryDelete.- Specified by:
deletein interfaceMinioRepository- Parameters:
id- the id
-
deleteAll
public List<io.minio.messages.DeleteError> deleteAll(Collection<MinioObjectId> ids)
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
-
-