diff --git a/options-home.json b/options-home.json index d9c0b23..8a0d98f 100644 --- a/options-home.json +++ b/options-home.json @@ -4,5 +4,6 @@ "gitLocalPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\repos", "downloadPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\zip", "zipPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\zip\\molokoin-client-master.zip", - "unzipPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\unzip\\molokoin" + "unzipPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\unzip\\molokoin", + "destinationPath" : "C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\var\\www\\html" } \ No newline at end of file diff --git a/out/repos b/out/repos index e2da4b5..ab1d9fe 160000 --- a/out/repos +++ b/out/repos @@ -1 +1 @@ -Subproject commit e2da4b5e0f84dbd6604466f57a4821875a25b2f5 +Subproject commit ab1d9fe840340945098569399bb6ec50d5daccc0 diff --git a/out/unzip/molokoin/molokoin-client/css/style.css b/out/war/www/html/css/style.css similarity index 100% rename from out/unzip/molokoin/molokoin-client/css/style.css rename to out/war/www/html/css/style.css diff --git a/out/unzip/molokoin/molokoin-client/index.html b/out/war/www/html/index.html similarity index 100% rename from out/unzip/molokoin/molokoin-client/index.html rename to out/war/www/html/index.html diff --git a/out/unzip/molokoin/molokoin-client/js/main.js b/out/war/www/html/js/main.js similarity index 100% rename from out/unzip/molokoin/molokoin-client/js/main.js rename to out/war/www/html/js/main.js diff --git a/out/zip/molokoin-client-master.zip b/out/zip/molokoin-client-master.zip index 0016d90..adefef5 100644 Binary files a/out/zip/molokoin-client-master.zip and b/out/zip/molokoin-client-master.zip differ diff --git a/src/main/java/ru/molokoin/sourceListener/GitListener.java b/src/main/java/ru/molokoin/sourceListener/GitListener.java index cfba7cc..d27e9d9 100644 --- a/src/main/java/ru/molokoin/sourceListener/GitListener.java +++ b/src/main/java/ru/molokoin/sourceListener/GitListener.java @@ -4,6 +4,10 @@ import java.io.BufferedInputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.nio.file.CopyOption; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; import java.util.Enumeration; import java.util.concurrent.DelayQueue; import java.util.zip.ZipEntry; @@ -27,7 +31,7 @@ import ru.molokoin.sourceListener.opt.Options; public class GitListener { public Options opt; - public String optionsPath = "options-main.json"; + public String optionsPath = "options-home.json"; public GitListener(){ try { @@ -70,6 +74,7 @@ public class GitListener { try { NetService.download(opt.getZipLink(), opt.getDownloadPath()); extract(); + move(); } catch (IOException e) { System.out.println(e.getMessage()); } @@ -127,6 +132,16 @@ public class GitListener { System.out.println("Распаковка архива завершена."); } } + + /** + * + */ + public void move() throws IOException { + Path source = Path.of("C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\unzip\\molokoin\\molokoin-client"); + Path target = Path.of("C:\\Users\\Strannik\\Documents\\esoe\\code\\sourceListener\\out\\war\\www\\html"); + System.out.println("Перемещение контента ... "); + Files.move(source, target, StandardCopyOption.REPLACE_EXISTING); + } public static void main(String[] args) throws InvalidRemoteException, TransportException, GitAPIException, IOException { //создаем объект класса, читаем файл с опциями @@ -145,5 +160,6 @@ public class GitListener { git = GitServiceFace.copy(ear.getOpt().getGitLink(), ear.getOpt().getGitLocalPath()); } ear.live(git); + } } diff --git a/src/main/java/ru/molokoin/sourceListener/opt/Options.java b/src/main/java/ru/molokoin/sourceListener/opt/Options.java index 2dc40d4..cf48226 100644 --- a/src/main/java/ru/molokoin/sourceListener/opt/Options.java +++ b/src/main/java/ru/molokoin/sourceListener/opt/Options.java @@ -7,6 +7,7 @@ public class Options { private String downloadPath; private String zipPath; private String unzipPath; + private String destinationPath; public Options(){} public void setZipLink(String zipLink) { @@ -45,6 +46,12 @@ public class Options { public String getZipPath() { return zipPath; } + public void setDestinationPath(String destinationPath) { + this.destinationPath = destinationPath; + } + public String getDestinationPath() { + return destinationPath; + } @Override public String toString() { String s = "zipLink : " + getZipLink() + "\n"; @@ -53,6 +60,7 @@ public class Options { s = s + "downloadPath : " + getDownloadPath() + "\n"; s = s + "zipPath : " + getZipPath() + "\n"; s = s + "unzipPath : " + getUnzipPath() + "\n"; + s = s + "destinationPath : " + getDestinationPath() + "\n"; return s; } } diff --git a/target/classes/ru/molokoin/sourceListener/GitListener.class b/target/classes/ru/molokoin/sourceListener/GitListener.class index 1afaef1..a493e9d 100644 Binary files a/target/classes/ru/molokoin/sourceListener/GitListener.class and b/target/classes/ru/molokoin/sourceListener/GitListener.class differ diff --git a/target/classes/ru/molokoin/sourceListener/opt/Options.class b/target/classes/ru/molokoin/sourceListener/opt/Options.class index 7148244..5b292d6 100644 Binary files a/target/classes/ru/molokoin/sourceListener/opt/Options.class and b/target/classes/ru/molokoin/sourceListener/opt/Options.class differ