@@ -0,0 +1,1572 @@
+package DGI.App;%0A%0Aimport java.io.*;%0Aimport java.util.Arrays;%0Aimport java.util.Comparator;%0A%0Aimport javax.swing.JOptionPane;%0A%0Apublic class RenameFiles%7B%0A %0A   public RenameFiles() throws Exception%7B%0A    %0A    %09//something here%0A   %7D%0A   %0A   public void doRename()%7B%0A%09// change file names in 'Directory':%0A       String absolutePath = App.catchPath;%0A       File dir = new File(absolutePath);%0A       File%5B%5D filesInDir = dir.listFiles();%0A       int i = 0;%0A%0A       %0A      %0A    %0A       %0A       //Sort then NUMERICALY before Rename it ascendant%0A       Arrays.sort(filesInDir, new Comparator%3CFile%3E() %7B%0A    %09    public int compare(File f1, File f2) %7B%0A%0A    %09        try %7B%0A    %09        %09   %0A        %09           int i1 = Integer.parseInt(f1.getName().replaceFirst(%22%5E%5BA-z%5D*.(.+?)%5C%5C.pdf%22, %22$1%22));%0A        %09           int i2 = Integer.parseInt(f2.getName().replaceFirst(%22%5E%5BA-z%5D*.(.+?)%5C%5C.pdf%22, %22$1%22));%0A        %09           %0A        %09           return i1 - i2;%0A        %09           %0A        %09           %0A        %09        %7D catch(AssertionError e) %7B%0A        %09        %09%0A        %09            throw new AssertionError(e);%0A        %09           %0A        %09            %0A        %09        %7D %0A        %09    %7D%0A        %09%7D);%0A     %0A       //Rename the mfs%0A       for(File file:filesInDir) %7B%0A           i++;%0A           String newName = i + %22.pdf%22;%0A           String newPath = absolutePath + %22%5C%5C%22 + newName;%0A           file.renameTo(new File(newPath));%0A          %0A       %7D%0A       //Dialog for success%0A       JOptionPane.showMessageDialog(null, %22Files from your path were renamed!!%22);%0A    %0A       %0A       %0A       %0A  %7D%0A%7D%0A

Create RenameFiles.java