|
@@ -98,8 +98,8 @@ public class TestController {
|
|
|
@SneakyThrows
|
|
|
public static void main(String[] args) {
|
|
|
//byte[] streamBytes = FileStorageHelper.getStreamBytes(new FileInputStream(new File("D:\\test\\temp\\20211209_Eq440305000274029fde4b7f459a872d5e15646c285c.png")));
|
|
|
- byte[] streamBytes = FileStorageHelper.getStreamBytes(new FileInputStream(new File("D:\\test\\temp\\上海国际航空服务中心龙华二期_塔楼_F18_20211206.rvt")));
|
|
|
- System.out.println(DigestUtil.md5Hex(streamBytes));
|
|
|
+// byte[] streamBytes = FileStorageHelper.getStreamBytes(new FileInputStream(new File("D:\\test\\temp\\上海国际航空服务中心龙华二期_塔楼_F18_20211206.rvt")));
|
|
|
+// System.out.println(DigestUtil.md5Hex(streamBytes));
|
|
|
// 4ee40f88485bcbe9282592d6d97ce6ff
|
|
|
//EFDDF79F60624752814D8F2A36CD3B9D
|
|
|
// MinioClient minioClient=MinioClient.builder()
|
|
@@ -127,6 +127,32 @@ public class TestController {
|
|
|
// System.out.println(getObjectResponse.read());
|
|
|
// System.out.println(JSONObject.toJSONString(statObject));
|
|
|
|
|
|
+ MinioClient minioClient=MinioClient.builder()
|
|
|
+ .endpoint("http://common.ysbdtp.com",9000,false)
|
|
|
+ .credentials("persagy", "persagy@2021")
|
|
|
+ .region("GM+8")
|
|
|
+ .build();
|
|
|
+// GetObjectResponse objectResponse = minioClient.getObject(GetObjectArgs.builder()
|
|
|
+// .bucket("dataplatform")
|
|
|
+// .object("/20211228/1608088181183.svg")
|
|
|
+// .region("GM+8")
|
|
|
+// .build());
|
|
|
+// minioClient.uploadObject(UploadObjectArgs.builder()
|
|
|
+// .bucket("dataplatform")
|
|
|
+// .object("/20211228/1608088181183.svg")
|
|
|
+// .region("GM+8")
|
|
|
+// .contentType("text/xml")
|
|
|
+// .filename("D:\\test\\temp\\20211228_1608088181183.svg")
|
|
|
+// .build());
|
|
|
+ // Get information of an object.
|
|
|
+ StatObjectResponse statObject = minioClient
|
|
|
+ .statObject(StatObjectArgs.builder()
|
|
|
+ .bucket("dataplatform")
|
|
|
+ .object("/20211228/1608088181183.svg")
|
|
|
+ .region("GM+8")
|
|
|
+ .build());
|
|
|
+ System.out.println(JSONObject.toJSONString(statObject.contentType()));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|