Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.PrintStream;
- import javax.swing.JOptionPane;
- public class CacheFix
- {
- public static final File CACHE = new File(System.getProperty("user.home") + File.separator + "roatpkzv5");
- public static void main(String[] args)
- {
- myMysteryMethod(9);
- if (!CACHE.exists())
- {
- JOptionPane.showMessageDialog(null, "You do not have a cache", "Error", 0);
- return;
- }
- delete(CACHE);
- JOptionPane.showMessageDialog(null, "Deleted Cache", "Success!", 1);
- }
- public static void myMysteryMethod(int max)
- {
- for (int i = 1; i <= max; i++)
- {
- for (int j = 1; j <= max; j++) {
- System.out.print(String.format("%4d", new Object[] { Integer.valueOf(j * i) }));
- }
- System.out.println();
- }
- }
- public static void delete(File file)
- {
- File[] arrayOfFile;
- int j = (arrayOfFile = file.listFiles()).length;
- for (int i = 0; i < j; i++)
- {
- File f = arrayOfFile[i];
- if (f.isDirectory()) {
- delete(f);
- } else {
- f.delete();
- }
- }
- file.delete();
- }
- }
Add Comment
Please, Sign In to add comment