List of utility methods to do Rename File
void | renameToTemporaryName(final File flFileToRename, final String strPrefix) Rename the file to temporaty name with given prefix assert strPrefix != null : "Prefix cannot be null."; String strParent; final StringBuffer sbBuffer = new StringBuffer(); File flTemp; int iIndex = 0; strParent = flFileToRename.getParent(); do { iIndex++; ... |
void | renameToUpperCase(File dir) rename To Upper Case File files[] = dir.listFiles(); if (files != null) { for (int i = 0; i < files.length; i++) { files[i].renameTo(new File(files[i].getParentFile(), files[i].getName().toUpperCase())); if (files[i].isDirectory()) { renameToUpperCase(files[i]); |
boolean | renameWallpaper(String new_file_name, String old_file_name, Map reames a wallpaper and all its copies Iterator<Entry<String, Integer>> entries = dimmensions.entrySet().iterator(); boolean ok_1 = true; while (entries.hasNext()) { Entry<String, Integer> e = entries.next(); File old_file = new File(basepath + File.separator + e.getKey() + File.separator + old_file_name); File new_file = new File(basepath + File.separator + e.getKey() + File.separator + new_file_name); if (ok_1 && new_file.exists()) { ok_1 = ok_1 && new_file.delete(); ... |
void | renameWithConfirm(String tmpFilename, String filename) rename With Confirm if (!new File(tmpFilename).renameTo(new File(filename))) { throw new IOException("rename failed of " + filename); |