Package org.bremersee.data.minio
Class MinioMultipartFileImpl
- java.lang.Object
-
- org.bremersee.data.minio.MinioMultipartFileImpl
-
- All Implemented Interfaces:
MinioMultipartFile
,MinioObjectId
,MinioObjectInfo
,org.springframework.core.io.InputStreamSource
,org.springframework.web.multipart.MultipartFile
public class MinioMultipartFileImpl extends Object implements MinioMultipartFile
The minio multipart file implementation.- Author:
- Christian Bremer
-
-
Constructor Summary
Constructors Constructor Description MinioMultipartFileImpl(MinioOperations minioOperations, String region, io.minio.StatObjectResponse objectStatus)
Instantiates a new minio multipart file.MinioMultipartFileImpl(MinioOperations minioOperations, String region, String bucket, io.minio.messages.Item item)
Instantiates a new minio multipart file.MinioMultipartFileImpl(MinioOperations minioOperations, MinioObjectInfo minioObjectInfo)
Instantiates a new minio multipart file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBytes()
String
getContentType()
String
getEtag()
Gets etag.InputStream
getInputStream()
OffsetDateTime
getLastModified()
Gets last modified time.String
getName()
Gets name.protected io.minio.StatObjectResponse
getObjectStatus()
Gets object status.String
getOriginalFilename()
long
getSize()
boolean
isEmpty()
void
transferTo(File dest)
-
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.MinioObjectId
getVersionId
-
Methods inherited from interface org.bremersee.data.minio.MinioObjectInfo
getBucket, getRegion
-
-
-
-
Constructor Detail
-
MinioMultipartFileImpl
public MinioMultipartFileImpl(MinioOperations minioOperations, MinioObjectInfo minioObjectInfo)
Instantiates a new minio multipart file.- Parameters:
minioOperations
- the minio operationsminioObjectInfo
- the minio object info
-
MinioMultipartFileImpl
public MinioMultipartFileImpl(MinioOperations minioOperations, String region, io.minio.StatObjectResponse objectStatus)
Instantiates a new minio multipart file.- Parameters:
minioOperations
- the minio operationsregion
- the regionobjectStatus
- the object status
-
MinioMultipartFileImpl
public MinioMultipartFileImpl(MinioOperations minioOperations, String region, String bucket, io.minio.messages.Item item)
Instantiates a new minio multipart file.- Parameters:
minioOperations
- the minio operationsregion
- the regionbucket
- the bucketitem
- the item
-
-
Method Detail
-
getObjectStatus
protected io.minio.StatObjectResponse getObjectStatus()
Gets object status.- Returns:
- the object status
-
getName
@NonNull public String getName()
Description copied from interface:MinioObjectId
Gets name.- Specified by:
getName
in interfaceMinioObjectId
- Specified by:
getName
in interfaceorg.springframework.web.multipart.MultipartFile
- Returns:
- the name
-
getOriginalFilename
public String getOriginalFilename()
- Specified by:
getOriginalFilename
in interfaceorg.springframework.web.multipart.MultipartFile
-
getContentType
public String getContentType()
- Specified by:
getContentType
in interfaceorg.springframework.web.multipart.MultipartFile
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceorg.springframework.web.multipart.MultipartFile
-
getSize
public long getSize()
- Specified by:
getSize
in interfaceorg.springframework.web.multipart.MultipartFile
-
getBytes
@NonNull public byte[] getBytes() throws IOException
- Specified by:
getBytes
in interfaceorg.springframework.web.multipart.MultipartFile
- Throws:
IOException
-
getInputStream
@NonNull public InputStream getInputStream()
- Specified by:
getInputStream
in interfaceorg.springframework.core.io.InputStreamSource
- Specified by:
getInputStream
in interfaceorg.springframework.web.multipart.MultipartFile
-
transferTo
public void transferTo(@NonNull File dest) throws IOException, IllegalStateException
- Specified by:
transferTo
in interfaceorg.springframework.web.multipart.MultipartFile
- Throws:
IOException
IllegalStateException
-
getEtag
public String getEtag()
Description copied from interface:MinioObjectInfo
Gets etag.- Specified by:
getEtag
in interfaceMinioObjectInfo
- Returns:
- the etag
-
getLastModified
public OffsetDateTime getLastModified()
Description copied from interface:MinioObjectInfo
Gets last modified time.- Specified by:
getLastModified
in interfaceMinioObjectInfo
- Returns:
- the last modified time
-
-