mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
Merge branch 'feature-jcloud-store-7.6' into feature-jcloud-store-9.0
This commit is contained in:
@@ -805,7 +805,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>eu.openaire</groupId>
|
<groupId>eu.openaire</groupId>
|
||||||
<artifactId>broker-client</artifactId>
|
<artifactId>broker-client</artifactId>
|
||||||
@@ -839,7 +839,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.findify</groupId>
|
<groupId>io.findify</groupId>
|
||||||
<artifactId>s3mock_2.13</artifactId>
|
<artifactId>s3mock_2.13</artifactId>
|
||||||
|
@@ -11,6 +11,8 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
@@ -347,34 +349,34 @@ public class JCloudBitStoreService extends BaseBitStoreService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Map about(Bitstream bitstream, Map attrs) throws IOException {
|
public Map<String, Object> about(Bitstream bitstream, List<String> attrs) throws IOException {
|
||||||
File file = getFile(bitstream);
|
File file = getFile(bitstream);
|
||||||
BlobStore blobStore = blobStoreContext.getBlobStore();
|
BlobStore blobStore = blobStoreContext.getBlobStore();
|
||||||
BlobMetadata blobMetadata = blobStore.blobMetadata(getContainer(), file.toString());
|
BlobMetadata blobMetadata = blobStore.blobMetadata(getContainer(), file.toString());
|
||||||
|
Map<String, Object> metadata = new HashMap<>();
|
||||||
if (blobMetadata != null) {
|
if (blobMetadata != null) {
|
||||||
ContentMetadata contentMetadata = blobMetadata.getContentMetadata();
|
ContentMetadata contentMetadata = blobMetadata.getContentMetadata();
|
||||||
|
|
||||||
if (contentMetadata != null) {
|
if (contentMetadata != null) {
|
||||||
attrs.put("size_bytes", String.valueOf(contentMetadata.getContentLength()));
|
metadata.put("size_bytes", String.valueOf(contentMetadata.getContentLength()));
|
||||||
final HashCode hashCode = contentMetadata.getContentMD5AsHashCode();
|
final HashCode hashCode = contentMetadata.getContentMD5AsHashCode();
|
||||||
if (hashCode != null) {
|
if (hashCode != null) {
|
||||||
attrs.put("checksum", Utils.toHex(contentMetadata.getContentMD5AsHashCode().asBytes()));
|
metadata.put("checksum", Utils.toHex(contentMetadata.getContentMD5AsHashCode().asBytes()));
|
||||||
attrs.put("checksum_algorithm", CSA);
|
metadata.put("checksum_algorithm", CSA);
|
||||||
}
|
}
|
||||||
attrs.put("modified", String.valueOf(blobMetadata.getLastModified().getTime()));
|
metadata.put("modified", String.valueOf(blobMetadata.getLastModified().getTime()));
|
||||||
|
|
||||||
attrs.put("ContentDisposition", contentMetadata.getContentDisposition());
|
metadata.put("ContentDisposition", contentMetadata.getContentDisposition());
|
||||||
attrs.put("ContentEncoding", contentMetadata.getContentEncoding());
|
metadata.put("ContentEncoding", contentMetadata.getContentEncoding());
|
||||||
attrs.put("ContentLanguage", contentMetadata.getContentLanguage());
|
metadata.put("ContentLanguage", contentMetadata.getContentLanguage());
|
||||||
attrs.put("ContentType", contentMetadata.getContentType());
|
metadata.put("ContentType", contentMetadata.getContentType());
|
||||||
|
|
||||||
if (contentMetadata.getExpires() != null) {
|
if (contentMetadata.getExpires() != null) {
|
||||||
attrs.put("Expires", contentMetadata.getExpires().getTime());
|
metadata.put("Expires", contentMetadata.getExpires().getTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return attrs;
|
return metadata;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user