private Object lockDir(String caDir) { File caDirFile = new File(caDir); caDirFile.mkdirs(); if (SHARED_PROXIES) { FileLock fl = new FileLock(CA_DIR); try { fl.lock(); } catch (Exception e) { logger.warn("Failed to lock CA dir", e); } return fl; } else { jvmLock.lock(); return jvmLock; } }
private void unlock(Object fl) throws IOException { if (SHARED_PROXIES) { ((FileLock) fl).unlock(); } else { ((Lock) fl).unlock(); } }