@Override public void close() { lock.writeLock().lock(); try { super.close(); } finally { lock.writeLock().unlock(); } }
manager.close();
manager.close();
manager.close();
/** * Close the manager */ protected void closeManager() { if (manager != null) { manager.close(); manager = null; } }
/** * Close the manager */ protected void closeManager() { if (manager != null) { manager.close(); manager = null; } }
/** * Close the manager */ protected void closeManager() { if (manager != null) { manager.close(); manager = null; } }
@After public void tearDown() throws Exception { if (fsm != null) { fsm.close(); } }
@After public void tearDown() throws Exception { if (fsm != null) { fsm.close(); } }
@After public void tearDown() throws Exception { if (fsm != null) { fsm.close(); } }
} finally { if (manager != null) { manager.close();
log.error("Error while closing InputStream: " + e.getMessage(), e); manager.close();
} finally { if (manager != null) { manager.close();
manager.close();
log.error("Unable to process the zip file." + e.getMessage(), e); } finally { manager.close();
manager.close();
} finally { if (manager != null) { manager.close();
} finally { if (manager != null) { manager.close();
/** * @param source file location * @param destination target file location * @param filePattern pattern of the file * @param opts FileSystemOptions * @throws IOException */ private void copy(String source, String destination, String filePattern, FileSystemOptions opts) throws IOException { StandardFileSystemManager manager = FileConnectorUtils.getManager(); FileObject souFile = manager.resolveFile(source, opts); FileObject[] children = souFile.getChildren(); FilePattenMatcher patternMatcher = new FilePattenMatcher(filePattern); for (FileObject child : children) { try { if (patternMatcher.validate(child.getName().getBaseName())) { String name = child.getName().getBaseName(); FileObject outFile = manager.resolveFile(destination + File.separator + name, opts); outFile.copyFrom(child, Selectors.SELECT_FILES); } } catch (IOException e) { log.error("Error occurred while copying a file. " + e.getMessage(), e); } } manager.close(); } }
} finally { if (manager != null) { manager.close();