@Override public void close() throws Exception { if (fs != null) { fs.close(); } }
synchronized void decrRefCount() throws IOException { if (--refCount == 0) { synchronized (ZIP_FILESYSTEMS) { ZIP_FILESYSTEMS.remove(jarFile); } delegate.close(); } }
@Override public void close() { if(fs != null){ try { fs.close(); } catch (IOException e) { e.printStackTrace(); } } }
@Override public void tearDown() throws IOException { rootDir.getFileSystem().close(); }
if (fileSystem != null && fileSystem.isOpen()) { try { fileSystem.close(); } catch (IOException e) { if (LOG.isDebugEnabled()) {
public void close() throws IOException { fileSystem.close(); } }
if (fileSystem != null) { try { fileSystem.close(); } catch (IOException ex) { logger.log(Level.SEVERE, "Problem closing filesystem.", ex);
@Override public void run() { try { FILE_SYSTEM.close(); } catch (IOException ignore) { } } }));
@Override public void close() throws IOException { if (origFS == null) { return; } origFS.close(); // De-reference the original ZIP file system so it can be // garbage collected origFS = null; }
@Override public void close() throws IOException { for (FileSystem fs: fileSystems.values()) fs.close(); }
public void closeFS() throws IOException { java.nio.file.Path path = Paths.get(uri); java.nio.file.FileSystem fileSystem = path.getFileSystem(); fileSystem.close(); } }
@Override public void close() throws IOException { this.filesystem.close(); } }
@Override public void close() throws IOException { if (classLoader != null) { if (classLoader != null) { classLoader.close(); } if (fileSystem != null) { fileSystem.close(); } } }
@Override public void reset() { try { super.reset(); this.fs.close(); } catch (IOException e) { // Move on } } @Override
@Override public byte[] getCode() { try { byte[] code = Files.readAllBytes(path); if (isBLangBinaryFile(path)) { path.getFileSystem().close(); } return code; } catch (IOException e) { throw new BLangCompilerException("Error reading source file " + path); } }
@AfterClass public void tearDown() throws IOException { // reset java properties to original System.setProperty("java.io.tmpdir", systemTempDir); System.setProperty("user.name", systemUser); inMemoryFileSystem.close(); }
@After public void deleteTempFS() throws IOException { fs.close(); Files.deleteIfExists(zip); }
@Test public void isOpenAfterClose() throws IOException { fileSystem.close(); Assert.assertFalse("Should report as closed", fileSystem.isOpen()); }