import java.io.File;

public class FileProcessor {
	public static void run(File file) {
		while(true) {
			if (isFileExists(file)) {
				try {
					Process p = null;
					p = Runtime.getRuntime().exec(new String[] {"cmd.exe", "⁄c", file.getPath()}); 
					p.waitFor();
					break;
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}
	}
	
	public static void run(String filePath) {
		run(new File(filePath));
	}
	
	public static boolean isFileExists(String filePath) {
		File file = new File(filePath);
		return file.exists();
	}
	
	public static boolean isFileExists(File file) {
		return file.exists();
	}
}


블로그 이미지

행복그리고..

,