|
|
@ -4,6 +4,10 @@ import java.io.BufferedInputStream; |
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
import java.io.IOException; |
|
|
|
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.Enumeration; |
|
|
|
import java.util.concurrent.DelayQueue; |
|
|
|
import java.util.concurrent.DelayQueue; |
|
|
|
import java.util.zip.ZipEntry; |
|
|
|
import java.util.zip.ZipEntry; |
|
|
@ -27,7 +31,7 @@ import ru.molokoin.sourceListener.opt.Options; |
|
|
|
|
|
|
|
|
|
|
|
public class GitListener { |
|
|
|
public class GitListener { |
|
|
|
public Options opt; |
|
|
|
public Options opt; |
|
|
|
public String optionsPath = "options-main.json"; |
|
|
|
public String optionsPath = "options-home.json"; |
|
|
|
|
|
|
|
|
|
|
|
public GitListener(){ |
|
|
|
public GitListener(){ |
|
|
|
try { |
|
|
|
try { |
|
|
@ -70,6 +74,7 @@ public class GitListener { |
|
|
|
try { |
|
|
|
try { |
|
|
|
NetService.download(opt.getZipLink(), opt.getDownloadPath()); |
|
|
|
NetService.download(opt.getZipLink(), opt.getDownloadPath()); |
|
|
|
extract(); |
|
|
|
extract(); |
|
|
|
|
|
|
|
move(); |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
System.out.println(e.getMessage()); |
|
|
|
System.out.println(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
@ -127,6 +132,16 @@ public class GitListener { |
|
|
|
System.out.println("Распаковка архива завершена."); |
|
|
|
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 { |
|
|
|
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()); |
|
|
|
git = GitServiceFace.copy(ear.getOpt().getGitLink(), ear.getOpt().getGitLocalPath()); |
|
|
|
} |
|
|
|
} |
|
|
|
ear.live(git); |
|
|
|
ear.live(git); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|