public static void main(String[] args) throws InterruptedException, IOException { File dest = new File("D:/OCR process"); for(int j=0;;j++) { File srce=new File("D:/OCR pipe"); File [] files = srce.listFiles(); System.out.println("hai"); if(dest.list().length==0) { for (int i = 0; i < 1; i++) { //this line weeds out other directories/folders System.out.println(files[i]); File sourceFile = new File( "D:\\OCR pipe\\"+files[i].getName()); File destFile = new File("D:\\OCR process\\"+files[i].getName()); sourceFile.delete(); destFile.createNewFile(); System.out.println("This File is error and successfully moved to OCR_ERROR"); } try { Thread.sleep(3000); } catch(InterruptedException i) { } } } }
createNewFile
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)