|
|
|
@ -20,6 +20,7 @@ import org.eclipse.jgit.api.errors.GitAPIException;
@@ -20,6 +20,7 @@ import org.eclipse.jgit.api.errors.GitAPIException;
|
|
|
|
|
import org.eclipse.jgit.api.errors.InvalidRemoteException; |
|
|
|
|
import org.eclipse.jgit.api.errors.NoHeadException; |
|
|
|
|
import org.eclipse.jgit.api.errors.TransportException; |
|
|
|
|
import org.eclipse.jgit.util.FileUtils; |
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.exc.StreamReadException; |
|
|
|
|
import com.fasterxml.jackson.databind.DatabindException; |
|
|
|
@ -31,7 +32,7 @@ import ru.molokoin.sourceListener.opt.Options;
@@ -31,7 +32,7 @@ import ru.molokoin.sourceListener.opt.Options;
|
|
|
|
|
|
|
|
|
|
public class GitListener { |
|
|
|
|
public Options opt; |
|
|
|
|
public String optionsPath = "options-home.json"; |
|
|
|
|
public String optionsPath = "options-main.json"; |
|
|
|
|
|
|
|
|
|
public GitListener(){ |
|
|
|
|
try { |
|
|
|
@ -76,11 +77,11 @@ public class GitListener {
@@ -76,11 +77,11 @@ public class GitListener {
|
|
|
|
|
extract(); |
|
|
|
|
move(); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
System.out.println(e.getMessage()); |
|
|
|
|
System.out.println("Ошибка move(): " + e.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
Thread.sleep(2000); |
|
|
|
|
Thread.sleep(10000); |
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
System.out.println("Проспал!!! Ошибка!!!"); |
|
|
|
|
e.printStackTrace(); |
|
|
|
@ -137,10 +138,16 @@ public class GitListener {
@@ -137,10 +138,16 @@ public class GitListener {
|
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
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"); |
|
|
|
|
Path source = Path.of("/home/esoe/Documents/repos-listen/molokoin/unzip/molokoin-client"); |
|
|
|
|
Path target = Path.of(opt.getDestinationPath()); |
|
|
|
|
//освобождение target
|
|
|
|
|
System.out.println("освобождение target ..."); |
|
|
|
|
FileUtils.delete(target.toFile()); |
|
|
|
|
//перемещение контента
|
|
|
|
|
System.out.println("Перемещение контента ... "); |
|
|
|
|
Files.move(source, target, StandardCopyOption.REPLACE_EXISTING); |
|
|
|
|
Files.move(source, target, StandardCopyOption.ATOMIC_MOVE); |
|
|
|
|
System.out.println("Перемещение контента завершено. "); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws InvalidRemoteException, TransportException, GitAPIException, IOException { |
|
|
|
|