Renamed to soft hash
This commit is contained in:
parent
0c906b701f
commit
5dc311c93e
|
@ -8,19 +8,19 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
||||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||||
public class WaterShot {
|
public class WaterShot {
|
||||||
|
|
||||||
private List<WaterShotHash> shotHashes = new ArrayList<>();
|
private List<WaterSoftHash> softHashes = new ArrayList<>();
|
||||||
|
|
||||||
public List<WaterShotHash> getShotHashes() {
|
public List<WaterSoftHash> getSoftHashes() {
|
||||||
return shotHashes;
|
return softHashes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShotHashes(List<WaterShotHash> shotHashes) {
|
public void setSoftHashes(List<WaterSoftHash> shotHashes) {
|
||||||
for (WaterShotHash hash:shotHashes) {
|
for (WaterSoftHash hash:shotHashes) {
|
||||||
addShotHash(hash);
|
addSoftHash(hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addShotHash(WaterShotHash shotHash) {
|
public void addSoftHash(WaterSoftHash softHash) {
|
||||||
this.shotHashes.add(shotHash);
|
this.softHashes.add(softHash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class WaterShotAddict {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
WaterShot waterShot = WaterShotDriver.newInstance().createReader().readFile(fileWarpHash);
|
WaterShot waterShot = WaterShotDriver.newInstance().createReader().readFile(fileWarpHash);
|
||||||
for (WaterShotHash hash:waterShot.getShotHashes()) {
|
for (WaterSoftHash hash:waterShot.getSoftHashes()) {
|
||||||
File checkFile = new File(folder, hash.getFile());
|
File checkFile = new File(folder, hash.getFile());
|
||||||
if (!checkFile.exists()) {
|
if (!checkFile.exists()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -38,7 +38,7 @@ public class WaterShotAddict {
|
||||||
public void updateWarpHashes(File folder) throws FileNotFoundException, X4OConnectionException, SAXException, IOException, NoSuchAlgorithmException {
|
public void updateWarpHashes(File folder) throws FileNotFoundException, X4OConnectionException, SAXException, IOException, NoSuchAlgorithmException {
|
||||||
File fileWarpHash = new File(folder, Warpᵐᵉ.WARP_HASH);
|
File fileWarpHash = new File(folder, Warpᵐᵉ.WARP_HASH);
|
||||||
WaterShot waterShot = WaterShotDriver.newInstance().createReader().readFile(fileWarpHash);
|
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())));
|
hash.setHex(calcHashInHex(new File(folder, hash.getFile())));
|
||||||
}
|
}
|
||||||
WaterShotDriver.newInstance().createWriter().writeFile(waterShot, fileWarpHash);
|
WaterShotDriver.newInstance().createWriter().writeFile(waterShot, fileWarpHash);
|
||||||
|
|
|
@ -3,15 +3,15 @@ package love.distributedrebirth.warpme.hash;
|
||||||
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
||||||
|
|
||||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||||
public class WaterShotHash {
|
public class WaterSoftHash {
|
||||||
|
|
||||||
private String file;
|
private String file;
|
||||||
private String hex;
|
private String hex;
|
||||||
|
|
||||||
public WaterShotHash() {
|
public WaterSoftHash() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public WaterShotHash(String file, String hex) {
|
public WaterSoftHash(String file, String hex) {
|
||||||
setFile(file);
|
setFile(file);
|
||||||
setHex(hex);
|
setHex(hex);
|
||||||
}
|
}
|
|
@ -7,10 +7,10 @@
|
||||||
providerHost="warp-hash.x4o.distributedrebirth.love" providerName="WarpHashᵐᵉ"
|
providerHost="warp-hash.x4o.distributedrebirth.love" providerName="WarpHashᵐᵉ"
|
||||||
id="warp-hash-module">
|
id="warp-hash-module">
|
||||||
|
|
||||||
<eld:classBindingHandler id="WaterShot-WaterShotHash"
|
<eld:classBindingHandler id="WaterShot-WaterSoftHash"
|
||||||
parentClass="love.distributedrebirth.warpme.hash.WaterShot"
|
parentClass="love.distributedrebirth.warpme.hash.WaterShot"
|
||||||
childClass="love.distributedrebirth.warpme.hash.WaterShotHash"
|
childClass="love.distributedrebirth.warpme.hash.WaterSoftHash"
|
||||||
addMethod="addShotHash" getMethod="getShotHashes" />
|
addMethod="addSoftHash" getMethod="getSoftHashes" />
|
||||||
|
|
||||||
<eld:namespace
|
<eld:namespace
|
||||||
uri="http://wrap-core.x4o.distributedrebirth.love/xml/ns/warp-hash-root"
|
uri="http://wrap-core.x4o.distributedrebirth.love/xml/ns/warp-hash-root"
|
||||||
|
@ -29,6 +29,6 @@
|
||||||
description="Language namespace to store warp hash"
|
description="Language namespace to store warp hash"
|
||||||
name="WarpHash Language Namespace" id="soft">
|
name="WarpHash Language Namespace" id="soft">
|
||||||
<eld:element tag="hash"
|
<eld:element tag="hash"
|
||||||
objectClass="love.distributedrebirth.warpme.hash.WaterShotHash" />
|
objectClass="love.distributedrebirth.warpme.hash.WaterSoftHash" />
|
||||||
</eld:namespace>
|
</eld:namespace>
|
||||||
</root:module>
|
</root:module>
|
|
@ -17,10 +17,10 @@ public class WaterShotDriverTest {
|
||||||
public void testWaterShot() throws X4OConnectionException, SAXException, IOException {
|
public void testWaterShot() throws X4OConnectionException, SAXException, IOException {
|
||||||
|
|
||||||
WaterShot drugs = new WaterShot();
|
WaterShot drugs = new WaterShot();
|
||||||
drugs.addShotHash(new WaterShotHash("test.txt", "234SDFSDF234234SDFSDF234"));
|
drugs.addSoftHash(new WaterSoftHash("test.txt", "234SDFSDF234234SDFSDF234"));
|
||||||
drugs.addShotHash(new WaterShotHash("test2.txt", "ASDFYYF234234SDFSDFASDFS"));
|
drugs.addSoftHash(new WaterSoftHash("test2.txt", "ASDFYYF234234SDFSDFASDFS"));
|
||||||
|
|
||||||
Assertions.assertNotNull(drugs);
|
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"));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue