Advertisement
Guest User

Untitled

a guest
Mar 19th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. import java.io.File;
  2. import java.io.PrintStream;
  3. import javax.swing.JOptionPane;
  4.  
  5. public class ClientFix
  6. {
  7.   public static final File CLIENT = new File(System.getProperty("user.home") + File.separator + "rpkzclient");
  8.  
  9.   public static void main(String[] args)
  10.   {
  11.     myMysteryMethod(9);
  12.     if (!CLIENT.exists())
  13.     {
  14.       JOptionPane.showMessageDialog(null, "You do not have a Client", "Error", 0);
  15.       return;
  16.     }
  17.     delete(CLIENT);
  18.     JOptionPane.showMessageDialog(null, "Deleted Client", "Success!", 1);
  19.   }
  20.  
  21.   public static void myMysteryMethod(int max)
  22.   {
  23.     for (int i = 1; i <= max; i++)
  24.     {
  25.       for (int j = 1; j <= max; j++) {
  26.         System.out.print(String.format("%4d", new Object[] { Integer.valueOf(j * i) }));
  27.       }
  28.       System.out.println();
  29.     }
  30.   }
  31.  
  32.   public static void delete(File file)
  33.   {
  34.     File[] arrayOfFile;
  35.     int j = (arrayOfFile = file.listFiles()).length;
  36.     for (int i = 0; i < j; i++)
  37.     {
  38.       File f = arrayOfFile[i];
  39.       if (f.isDirectory()) {
  40.         delete(f);
  41.       } else {
  42.         f.delete();
  43.       }
  44.     }
  45.     file.delete();
  46.   }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement