Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SuppressWarnings("unchecked")
- public static HashMap<String, Integer> readWarningsFile()
- throws ClassNotFoundException, IOException
- {
- try (ObjectInputStream is = new ObjectInputStream(new FileInputStream(PATH))) {
- return (HashMap<String, Integer>) is.readObject();
- }
- }
- public static void saveWarningsFile(HashMap<String, Integer> users)
- throws IOException
- {
- File f = new File(WHITELIST_PATH);
- f.mkdirs();
- if(!f.exists())
- f.createNewFile();
- try (ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(PATH))) {
- os.writeObject(users);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement