|
|
|
@ -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); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|