esoe 2 years ago
parent
commit
a97c30af7f
  1. 3
      options-home.json
  2. 2
      out/repos
  3. 0
      out/war/www/html/css/style.css
  4. 0
      out/war/www/html/index.html
  5. 0
      out/war/www/html/js/main.js
  6. BIN
      out/zip/molokoin-client-master.zip
  7. 18
      src/main/java/ru/molokoin/sourceListener/GitListener.java
  8. 8
      src/main/java/ru/molokoin/sourceListener/opt/Options.java
  9. BIN
      target/classes/ru/molokoin/sourceListener/GitListener.class
  10. BIN
      target/classes/ru/molokoin/sourceListener/opt/Options.class

3
options-home.json

@ -4,5 +4,6 @@ @@ -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"
}

2
out/repos

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit e2da4b5e0f84dbd6604466f57a4821875a25b2f5
Subproject commit ab1d9fe840340945098569399bb6ec50d5daccc0

0
out/unzip/molokoin/molokoin-client/css/style.css → out/war/www/html/css/style.css

0
out/unzip/molokoin/molokoin-client/index.html → out/war/www/html/index.html

0
out/unzip/molokoin/molokoin-client/js/main.js → out/war/www/html/js/main.js

BIN
out/zip/molokoin-client-master.zip

Binary file not shown.

18
src/main/java/ru/molokoin/sourceListener/GitListener.java

@ -4,6 +4,10 @@ import java.io.BufferedInputStream; @@ -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; @@ -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 { @@ -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 { @@ -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 { @@ -145,5 +160,6 @@ public class GitListener {
git = GitServiceFace.copy(ear.getOpt().getGitLink(), ear.getOpt().getGitLocalPath());
}
ear.live(git);
}
}

8
src/main/java/ru/molokoin/sourceListener/opt/Options.java

@ -7,6 +7,7 @@ public class Options { @@ -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 { @@ -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 { @@ -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;
}
}

BIN
target/classes/ru/molokoin/sourceListener/GitListener.class

Binary file not shown.

BIN
target/classes/ru/molokoin/sourceListener/opt/Options.class

Binary file not shown.
Loading…
Cancel
Save