Compare commits
3 Commits
713f84e2da
...
1d5d6fdbef
Author | SHA1 | Date | |
---|---|---|---|
1d5d6fdbef | |||
2dd82fe247 | |||
4c1cee2077 |
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>kangaroo-and-rabbit</groupId>
|
||||
<artifactId>archidata</artifactId>
|
||||
<version>0.20.0</version>
|
||||
<version>0.20.2</version>
|
||||
<properties>
|
||||
<java.version>21</java.version>
|
||||
<maven.compiler.version>3.1</maven.compiler.version>
|
||||
|
@ -101,10 +101,19 @@ public class DataResource {
|
||||
|
||||
public static String getFileData(final ObjectId oid) {
|
||||
final String stringOid = oid.toHexString();
|
||||
final String part1 = stringOid.substring(0, 2);
|
||||
final String part2 = stringOid.substring(2, 4);
|
||||
final String part3 = stringOid.substring(4);
|
||||
final String finalPath = part1 + File.separator + part2;
|
||||
String dir1 = stringOid.substring(0, 2);
|
||||
String dir2 = stringOid.substring(2, 4);
|
||||
String dir3 = stringOid.substring(4, 6);
|
||||
try {
|
||||
final MessageDigest digest = MessageDigest.getInstance("SHA-256");
|
||||
final byte[] hashBytes = digest.digest(oid.toByteArray());
|
||||
dir1 = String.format("%02x", hashBytes[0]);
|
||||
dir2 = String.format("%02x", hashBytes[1]);
|
||||
dir3 = String.format("%02x", hashBytes[2]);
|
||||
} catch (final NoSuchAlgorithmException ex) {
|
||||
LOGGER.error("Fail to generate the hash of the objectId ==> ise direct value ... {}", ex.getMessage());
|
||||
}
|
||||
final String finalPath = dir1 + File.separator + dir2 + File.separator + dir3;
|
||||
String filePath = ConfigBaseVariable.getMediaDataFolder() + "_oid" + File.separator + finalPath
|
||||
+ File.separator;
|
||||
try {
|
||||
@ -112,7 +121,7 @@ public class DataResource {
|
||||
} catch (final IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
filePath += part3;
|
||||
filePath += stringOid;
|
||||
return filePath;
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
0.20.0
|
||||
0.20.2
|
||||
|
Loading…
Reference in New Issue
Block a user