package com.hsc.underwriting.test;
import org.junit.Test;
public class IOTest {
@Test
public final void testAutoMove() {
try {
String[] cmdArray = new String[5];
cmdArray[0] = "cmd.exe";
cmdArray[1] = "/C";
cmdArray[2] = "move";
cmdArray[3] = "incoming\\**";
cmdArray[4] = "outgoing\\";
Process autoMoveProcess = Runtime.getRuntime().exec(cmdArray);
//Thread.sleep(10000);
autoMoveProcess.waitFor();
autoMoveProcess.destroy();
} catch (Exception e) {
// TODO: handle exception
}
}
}
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html