turt2live

Untitled

Apr 8th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. package com.turt2live.ponies.engine;
  2.  
  3. /**
  4.  * For better file management
  5.  *
  6.  * @author turt2live
  7.  */
  8. public class File extends java.io.File {
  9.  
  10.     private static final long serialVersionUID = 7132240520683854795L;
  11.     private static final java.io.File resources = Settings.saveDirectory;
  12.  
  13.     public File(java.io.File parent, java.io.File child){
  14.         super(getPath(new java.io.File(parent, child.getPath())));
  15.     }
  16.  
  17.     public File(java.io.File parent, String child){
  18.         super(getPath(new java.io.File(parent, child)));
  19.     }
  20.  
  21.     public File(String parent, String child){
  22.         super(getPath(new java.io.File(parent, child)));
  23.     }
  24.  
  25.     public File(java.io.File file){
  26.         super(getPath(file));
  27.     }
  28.  
  29.     public File(String path){
  30.         super(getPath(new java.io.File(path)));
  31.     }
  32.  
  33.     /**
  34.      * Gets the local resource path
  35.      *
  36.      * @param file the java file
  37.      * @return the Pony Gladiators file requested
  38.      */
  39.     private static String getPath(java.io.File file){
  40.         return new File(resources, file).getPath();
  41.     }
  42.  
  43.     /**
  44.      * Unpacks the required contents to the directory
  45.      */
  46.     public static void unpack(){
  47.         // TODO: Implement
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment