|
@@ -77,14 +77,14 @@ public class OssStore implements FileStore {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void write(String path, InputStream ins, String md5) throws Exception {
|
|
|
+ public void write(String path, InputStream ins, String md5) {
|
|
|
ObjectMetadata metadata = new ObjectMetadata();
|
|
|
metadata.setContentMD5(toBase64(md5));
|
|
|
ossClient.putObject(bucket, formatPath(path), ins, metadata);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public InputStream read(String path) throws Exception {
|
|
|
+ public InputStream read(String path) {
|
|
|
OSSObject ossObject = ossClient.getObject(bucket, formatPath(path));
|
|
|
return ossObject.getObjectContent();
|
|
|
}
|
|
@@ -98,6 +98,12 @@ public class OssStore implements FileStore {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean delete(String path) {
|
|
|
+ ossClient.deleteObject(bucket, formatPath(path));
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void close() {
|
|
|
if (ossClient != null) {
|
|
@@ -107,4 +113,5 @@ public class OssStore implements FileStore {
|
|
|
temporaryUrlClient.shutdown();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|