private static void closeStorage(@Nullable AbstractStateStorage<?, ?> storage) throws IOException { if (storage != null) { synchronized (storage) { storage.close(); } } }
private static void wipeStorage(File root, @Nullable AbstractStateStorage<?, ?> storage) { if (storage != null) { synchronized (storage) { storage.wipe(); } } else { FileUtil.delete(root); } }