Advertisement
Benjamin_Loison

PatchOptimization

Aug 13th, 2016
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. package fr.benjaminloison.patchoptimizationpng.main;
  2.  
  3. import java.io.File;
  4.  
  5. public class PatchOptimizationPNG
  6. {
  7.     public static void main(String[] args)
  8.     {
  9.         clean(new File(new File("").getAbsolutePath() + File.separatorChar).list());
  10.     }
  11.  
  12.     private static void clean(String[] files)
  13.     {
  14.         for(int i = 0; i < files.length; i++)
  15.         {
  16.             File file = new File(files[i]);
  17.             String path = file.getAbsolutePath();
  18.             if(file.isDirectory())
  19.             {
  20.                 String pathFile = path + File.separatorChar, underFiles[] = new File(pathFile).list();
  21.                 for(int j = 0; j < underFiles.length; j++)
  22.                     underFiles[j] = pathFile + underFiles[j];
  23.                 clean(underFiles);
  24.             }
  25.             else if(path.contains("-min"))
  26.                 file.renameTo(new File(path.replace("-min", "")));
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement