промежуточный. ликвидировал велосипед с копированием папок

This commit is contained in:
2023-10-02 19:11:24 +03:00
parent 1934863bff
commit 6372fce1ac
3 changed files with 5 additions and 22 deletions

View File

@@ -1036,25 +1036,5 @@ public class Utils {
}
return false;
}
public static void copyDirectory(File src, File dst) throws Exception {
int code = Constants.Nan;
String command =
Global.isWindows ?
("xcopy " +
Utils.DQuotes(src.getAbsolutePath()) + " " +
Utils.DQuotes(dst.getAbsolutePath()) + " /e")
:
("cp -r " + Utils.DQuotes(src.getAbsolutePath()) + " " +
Utils.DQuotes(dst.getAbsolutePath())
);
try {
code = Runtime.getRuntime().exec(command).waitFor();
} catch (Exception ex) {
ex.printStackTrace();
throw new PassException("Команда " + command + " завершилась с исключением.");
}
if (code != 0)
throw new PassException("Команда " + command + " завершилась с кодом " + code);
}
}