Bruce-Hopkins / File-Renamer

Renames files for better sorting on certain devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File-Renamer

Description

This is made to add zeroes to the end of folders and files to allow the files to be sorted in the right order on certain devices.

Usage

// Create new instance and use the find() method to specify the main folder which will be used
DirectoryRenamer directoryFinder = new DirectoryRenamer();
File[] directories = directoryFinder.find(directory);

// Go through all the folders in that directory
for(File directory : directories) {
  if (directory.isDirectory()) {
      /* The first parameter is the current directory it will rename. 
      The Second is the common name among the files. (For instance if the folders are named "album1" and "album2" the common name would be "album")
      */
      String newDirectoryName = directoryFinder.rename(directory, "page");
      
      // imageRenamer has the same mehthod as directoryFinder. Only difference is imageRenamer will only accept ".png", ".jpg", or ".jpeg" files.    
}

About

Renames files for better sorting on certain devices

License:MIT License


Languages

Language:Java 100.0%