Che gran pasticcio
Da usarecodice:public static void moveFile(String filePath, String dirPath) throws Exception { File file = new File(filePath); if(!file.renameTo(new File(dirPath + "\\" + file.getName()))) throw new Exception("Cannot move file " + file.getAbsolutePath()); }
codice:try{ moveFile("C:\\Dir\\Dir\\file.ext","C:\\Dir\\NewDir"); }catch(Exception e){ //... }


Rispondi quotando