List of utility methods to do File Move nui
void | moveFile(String source, String target) move File copyFile(source, target); deleteFile(source); |
boolean | moveFile(String sourceFile, String destFile) Moves a file. java.io.File source = new java.io.File(sourceFile); java.io.File dest = new java.io.File(destFile); try { copyFile(source, dest); source.delete(); return true; } catch (IOException e) { e.printStackTrace(); ... |
boolean | moveFiles(File src, String newSrc, File dest) Moves the source file to the destination file (similar to #copyFiles(File,File) but with deletion) boolean r = false; if (!dest.exists()) { r = dest.mkdirs(); File[] files = src.listFiles(); if (files == null) { try { Files.move(src.toPath(), new File(dest, newSrc).toPath(), StandardCopyOption.REPLACE_EXISTING); ... |
void | mover(String file, String caminhoNovo) mover File arquivo = new File(file); File caminhoNovoFile = new File(caminhoNovo + arquivo); try { Files.move(arquivo.toPath(), caminhoNovoFile.toPath()); } catch (Exception e) { |