Compare commits

...

3 Commits

Author SHA1 Message Date
1d5d6fdbef [RELEASE] Release v0.20.2 2025-01-05 22:49:48 +01:00
2dd82fe247 [FIX] path of the stored data 2025-01-05 22:48:53 +01:00
4c1cee2077 [VERSION] update dev tag version 2025-01-05 21:56:38 +01:00
3 changed files with 16 additions and 7 deletions

View File

@ -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>

View File

@ -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;
}

View File

@ -1 +1 @@
0.20.0
0.20.2