Java Rename File renameToUpperCase(File dir)

Here you can find the source of renameToUpperCase(File dir)

Description

rename To Upper Case

License

Open Source License

Declaration

public static void renameToUpperCase(File dir) throws IOException 

Method Source Code


//package com.java2s;
import java.io.File;

import java.io.IOException;

public class Main {
    public static void renameToUpperCase(File dir) throws IOException {
        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]);
                }/*from  w ww.  ja v a  2 s  .  c  o m*/
            }
        }
    }
}

Related

  1. renameToBackupName(File file)
  2. renameToBackupName(File file)
  3. renameToNextSequencedFile(String srcfile, String destfolder, String prefix, String suffix)
  4. renameToTempDir(File file, String newName)
  5. renameToTemporaryName(final File flFileToRename, final String strPrefix)
  6. renameWallpaper(String new_file_name, String old_file_name, Map dimmensions, String basepath, List resolution_directories)
  7. renameWithConfirm(String tmpFilename, String filename)