Advertisement
Camer047

Untitled

May 4th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1.  
  2. @SuppressWarnings("unchecked")
  3. public static void loadTokens() {
  4.  
  5. String fileDir = main
  6. .getConfig()
  7. .getString("saveDir");
  8.  
  9. try {
  10. FileInputStream fileIn = new FileInputStream(
  11. fileDir);
  12. ObjectInputStream in = new ObjectInputStream(fileIn);
  13. MiniTokenMain.usTokens = (HashMap<UUID, Integer>) in.readObject();
  14. in.close();
  15. fileIn.close();
  16. } catch (IOException i) {
  17. i.printStackTrace();
  18. } catch (ClassNotFoundException c) {
  19. System.out.println("Class not found");
  20. c.printStackTrace();
  21. }
  22.  
  23. }
  24.  
  25.  
  26. public static void saveToaddTokens() {
  27.  
  28. String fileDir = main.getConfig().getString("saveDirTwo");
  29.  
  30. try {
  31. FileOutputStream fileOut = new FileOutputStream(
  32. fileDir);
  33. ObjectOutputStream out = new ObjectOutputStream(fileOut);
  34. out.writeObject(MiniTokenMain.toAddTokens);
  35. out.close();
  36. fileOut.close();
  37. } catch (IOException i) {
  38. i.printStackTrace();
  39. }
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement