Compare commits

..

No commits in common. "1d5d6fdbef6bb1fec01e786c108fc13ad1187aec" and "713f84e2da9757c1adfcac9e6952b303e1e49a37" have entirely different histories.

3 changed files with 7 additions and 16 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>kangaroo-and-rabbit</groupId>
<artifactId>archidata</artifactId>
<version>0.20.2</version>
<version>0.20.0</version>
<properties>
<java.version>21</java.version>
<maven.compiler.version>3.1</maven.compiler.version>

View File

@ -101,19 +101,10 @@ public class DataResource {
public static String getFileData(final ObjectId oid) {
final String stringOid = oid.toHexString();
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;
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 filePath = ConfigBaseVariable.getMediaDataFolder() + "_oid" + File.separator + finalPath
+ File.separator;
try {
@ -121,7 +112,7 @@ public class DataResource {
} catch (final IOException e) {
e.printStackTrace();
}
filePath += stringOid;
filePath += part3;
return filePath;
}

View File

@ -1 +1 @@
0.20.2
0.20.0