Exemplo n.º 1
0
 private List<LazyHostPlugin> loadFromCache(final AtomicLong lastFolderModification)
     throws IOException {
   final boolean readL = LOCK.readLock();
   try {
     return LazyHostPluginCache.read(
         Application.getTempResource(getCache()), lastFolderModification);
   } finally {
     LOCK.readUnlock(readL);
   }
 }
Exemplo n.º 2
0
 private void save(List<LazyHostPlugin> save, final AtomicLong lastFolderModification) {
   if (save != null) {
     LOCK.writeLock();
     final File cache = Application.getTempResource(getCache());
     try {
       LazyHostPluginCache.write(save, cache, lastFolderModification);
     } catch (final Throwable e) {
       final LogSource log = LogController.CL(false);
       log.log(e);
       log.close();
       cache.delete();
     } finally {
       LOCK.writeUnlock();
       FileCreationManager.getInstance()
           .delete(Application.getTempResource(TMP_INVALIDPLUGINS), null);
     }
   }
 }