-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat($OSS): get information of an object
- Loading branch information
1 parent
4da6876
commit 3663f06
Showing
6 changed files
with
140 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...r/src/main/java/com/jmsoftware/maf/osscenter/read/entity/SerializableGenericResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.jmsoftware.maf.osscenter.read.entity; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Data; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* Description: SerializableGenericResponse, change description here. | ||
* | ||
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com, date: 8/12/2021 5:07 PM | ||
**/ | ||
@Data | ||
@Setter(AccessLevel.PROTECTED) | ||
public class SerializableGenericResponse { | ||
private Map<String, List<String>> headers; | ||
private String bucket; | ||
private String region; | ||
private String object; | ||
} |
45 changes: 45 additions & 0 deletions
45
...rc/main/java/com/jmsoftware/maf/osscenter/read/entity/SerializableStatObjectResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.jmsoftware.maf.osscenter.read.entity; | ||
|
||
import io.minio.StatObjectResponse; | ||
import io.minio.messages.LegalHold; | ||
import io.minio.messages.RetentionMode; | ||
import lombok.*; | ||
|
||
import java.time.ZonedDateTime; | ||
import java.util.Map; | ||
|
||
/** | ||
* Description: SerializableStatObjectResponse, change description here. | ||
* | ||
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com, date: 8/12/2021 5:04 PM | ||
**/ | ||
@Data | ||
@Setter(AccessLevel.NONE) | ||
@EqualsAndHashCode(callSuper = true) | ||
public class SerializableStatObjectResponse extends SerializableGenericResponse { | ||
private String etag; | ||
private long size; | ||
private ZonedDateTime lastModified; | ||
private RetentionMode retentionMode; | ||
private ZonedDateTime retentionRetainUntilDate; | ||
private LegalHold legalHold; | ||
private boolean deleteMarker; | ||
private Map<String, String> userMetadata; | ||
|
||
public static SerializableStatObjectResponse build(StatObjectResponse statObjectResponse) { | ||
val serializableStatObjectResponse = new SerializableStatObjectResponse(); | ||
serializableStatObjectResponse.setHeaders(statObjectResponse.headers().toMultimap()); | ||
serializableStatObjectResponse.setBucket(statObjectResponse.bucket()); | ||
serializableStatObjectResponse.setRegion(statObjectResponse.region()); | ||
serializableStatObjectResponse.setObject(statObjectResponse.object()); | ||
serializableStatObjectResponse.etag = statObjectResponse.etag(); | ||
serializableStatObjectResponse.size = statObjectResponse.size(); | ||
serializableStatObjectResponse.lastModified = statObjectResponse.lastModified(); | ||
serializableStatObjectResponse.retentionMode = statObjectResponse.retentionMode(); | ||
serializableStatObjectResponse.retentionRetainUntilDate = statObjectResponse.retentionRetainUntilDate(); | ||
serializableStatObjectResponse.legalHold = statObjectResponse.legalHold(); | ||
serializableStatObjectResponse.deleteMarker = statObjectResponse.deleteMarker(); | ||
serializableStatObjectResponse.userMetadata = statObjectResponse.userMetadata(); | ||
return serializableStatObjectResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters