Created
January 30, 2012 06:10
-
-
Save wataru420/1702859 to your computer and use it in GitHub Desktop.
ProcessBuilderでワイルドカードを使いたいとき
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void cp(String source, String dist) throws Exception { | |
String command = "cp " + source + " " + dist; | |
String[] cmd = new String[] { "/bin/sh", "-c", command }; | |
this.exec(cmd); | |
ProcessBuilder pb = new ProcessBuilder(cmd); | |
Process p = pb.start(); | |
int val = p.waitFor(); | |
if (val != 0) { | |
this.logErrorCommand(cmd); | |
throw new Exception("Exception during RSync; return code = " + val); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment