From 5dc311c93e13d92eb4e543afbff3215574fc9273 Mon Sep 17 00:00:00 2001 From: Willem Date: Wed, 23 Feb 2022 17:16:54 +0100 Subject: [PATCH] Renamed to soft hash --- .../warpme/hash/WaterShot.java | 16 ++++++++-------- .../warpme/hash/WaterShotAddict.java | 4 ++-- .../{WaterShotHash.java => WaterSoftHash.java} | 6 +++--- .../META-INF/warp-hash/warp-hash-lang.eld | 8 ++++---- .../warpme/hash/WaterShotDriverTest.java | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) rename lib-warpme/src/main/love/distributedrebirth/warpme/hash/{WaterShotHash.java => WaterSoftHash.java} (82%) diff --git a/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShot.java b/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShot.java index b8fab613..06b4eb6d 100644 --- a/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShot.java +++ b/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShot.java @@ -8,19 +8,19 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class WaterShot { - private List shotHashes = new ArrayList<>(); + private List softHashes = new ArrayList<>(); - public List getShotHashes() { - return shotHashes; + public List getSoftHashes() { + return softHashes; } - public void setShotHashes(List shotHashes) { - for (WaterShotHash hash:shotHashes) { - addShotHash(hash); + public void setSoftHashes(List shotHashes) { + for (WaterSoftHash hash:shotHashes) { + addSoftHash(hash); } } - public void addShotHash(WaterShotHash shotHash) { - this.shotHashes.add(shotHash); + public void addSoftHash(WaterSoftHash softHash) { + this.softHashes.add(softHash); } } diff --git a/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShotAddict.java b/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShotAddict.java index d8f956b6..690dbd6b 100644 --- a/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShotAddict.java +++ b/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShotAddict.java @@ -22,7 +22,7 @@ public class WaterShotAddict { return false; } WaterShot waterShot = WaterShotDriver.newInstance().createReader().readFile(fileWarpHash); - for (WaterShotHash hash:waterShot.getShotHashes()) { + for (WaterSoftHash hash:waterShot.getSoftHashes()) { File checkFile = new File(folder, hash.getFile()); if (!checkFile.exists()) { return false; @@ -38,7 +38,7 @@ public class WaterShotAddict { public void updateWarpHashes(File folder) throws FileNotFoundException, X4OConnectionException, SAXException, IOException, NoSuchAlgorithmException { File fileWarpHash = new File(folder, Warpᵐᵉ.WARP_HASH); WaterShot waterShot = WaterShotDriver.newInstance().createReader().readFile(fileWarpHash); - for (WaterShotHash hash:waterShot.getShotHashes()) { + for (WaterSoftHash hash:waterShot.getSoftHashes()) { hash.setHex(calcHashInHex(new File(folder, hash.getFile()))); } WaterShotDriver.newInstance().createWriter().writeFile(waterShot, fileWarpHash); diff --git a/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShotHash.java b/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterSoftHash.java similarity index 82% rename from lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShotHash.java rename to lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterSoftHash.java index d5662b9e..5674cef6 100644 --- a/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterShotHash.java +++ b/lib-warpme/src/main/love/distributedrebirth/warpme/hash/WaterSoftHash.java @@ -3,15 +3,15 @@ package love.distributedrebirth.warpme.hash; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class WaterShotHash { +public class WaterSoftHash { private String file; private String hex; - public WaterShotHash() { + public WaterSoftHash() { } - public WaterShotHash(String file, String hex) { + public WaterSoftHash(String file, String hex) { setFile(file); setHex(hex); } diff --git a/lib-warpme/src/resources/META-INF/warp-hash/warp-hash-lang.eld b/lib-warpme/src/resources/META-INF/warp-hash/warp-hash-lang.eld index 044e1558..38c133b7 100644 --- a/lib-warpme/src/resources/META-INF/warp-hash/warp-hash-lang.eld +++ b/lib-warpme/src/resources/META-INF/warp-hash/warp-hash-lang.eld @@ -7,10 +7,10 @@ providerHost="warp-hash.x4o.distributedrebirth.love" providerName="WarpHashᵐᵉ" id="warp-hash-module"> - + childClass="love.distributedrebirth.warpme.hash.WaterSoftHash" + addMethod="addSoftHash" getMethod="getSoftHashes" /> + objectClass="love.distributedrebirth.warpme.hash.WaterSoftHash" /> \ No newline at end of file diff --git a/lib-warpme/src/test/love/distributedrebirth/warpme/hash/WaterShotDriverTest.java b/lib-warpme/src/test/love/distributedrebirth/warpme/hash/WaterShotDriverTest.java index 09f25151..6a97ec02 100644 --- a/lib-warpme/src/test/love/distributedrebirth/warpme/hash/WaterShotDriverTest.java +++ b/lib-warpme/src/test/love/distributedrebirth/warpme/hash/WaterShotDriverTest.java @@ -17,10 +17,10 @@ public class WaterShotDriverTest { public void testWaterShot() throws X4OConnectionException, SAXException, IOException { WaterShot drugs = new WaterShot(); - drugs.addShotHash(new WaterShotHash("test.txt", "234SDFSDF234234SDFSDF234")); - drugs.addShotHash(new WaterShotHash("test2.txt", "ASDFYYF234234SDFSDFASDFS")); + drugs.addSoftHash(new WaterSoftHash("test.txt", "234SDFSDF234234SDFSDF234")); + drugs.addSoftHash(new WaterSoftHash("test2.txt", "ASDFYYF234234SDFSDFASDFS")); Assertions.assertNotNull(drugs); - //WaterShotDriver.newInstance().createWriter().writeFile(drugs, new File("build/output.xml")); + WaterShotDriver.newInstance().createWriter().writeFile(drugs, new java.io.File("build/output.xml")); } } \ No newline at end of file