Advertisement
MsGamerHD

Untitled

Aug 13th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1.     public static int getType(File file, String path){
  2.         String typestring = getString(file, path);
  3.         int type = 0;
  4.        
  5.         if(typestring.contains(":")){
  6.             String[] typearray = typestring.split(":");
  7.  
  8.             try{
  9.                 type = Integer.parseInt(typearray[0]);
  10.             } catch (NumberFormatException d) {
  11.             }
  12.         } else {
  13.             try{
  14.                 type = Integer.parseInt(typestring);
  15.             } catch (NumberFormatException d) {
  16.             }
  17.         }
  18.         return type;
  19.     }
  20.    
  21.     public static int getData(File file, String path){
  22.         String typestring = getString(file, path);
  23.         int data = 0;
  24.        
  25.         if(typestring.contains(":")){
  26.             String[] typearray = typestring.split(":");
  27.  
  28.             try{
  29.                 data = Integer.parseInt(typearray[1]);
  30.             } catch (NumberFormatException d) {
  31.             }
  32.         }
  33.         return data;
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement