/** * Close a file. * * @param handle a SFTPv3FileHandle handle * @throws IOException */ public void closeFile(SFTPv3FileHandle handle) throws IOException { if (handle == null) throw new IllegalArgumentException("the handle argument may not be null"); try { if (handle.isClosed == false) { closeHandle(handle.fileHandle); } } finally { handle.isClosed = true; } } }
/** * List the contents of a directory. * * @param dirName See the {@link SFTPv3Client comment} for the class for more details. * @return A Vector containing {@link SFTPv3DirectoryEntry} objects. * @throws IOException */ public Vector ls(String dirName) throws IOException { byte[] handle = openDirectory(dirName); Vector result = scanDirectory(handle); closeHandle(handle); return result; }
/** * Close a file. * * @param handle a SFTPv3FileHandle handle * @throws IOException */ public void closeFile(SFTPv3FileHandle handle) throws IOException { try { while (!pendingReadQueue.isEmpty()) { this.readPendingReadStatus(); } while (!pendingStatusQueue.isEmpty()) { this.readStatus(); } if (!handle.isClosed) { closeHandle(handle.fileHandle); } } finally { handle.isClosed = true; } } }
/** * Close a file. * * @param handle a SFTPv3FileHandle handle * @throws IOException */ public void closeFile(SFTPv3FileHandle handle) throws IOException { try { while (!pendingReadQueue.isEmpty()) { this.readPendingReadStatus(); } while (!pendingStatusQueue.isEmpty()) { this.readStatus(); } if (!handle.isClosed) { closeHandle(handle.fileHandle); } } finally { handle.isClosed = true; } } }
/** * Close a file. * * @param handle a SFTPv3FileHandle handle * @throws IOException */ public void closeFile(SFTPv3FileHandle handle) throws IOException { try { while (!pendingReadQueue.isEmpty()) { this.readPendingReadStatus(); } while (!pendingStatusQueue.isEmpty()) { this.readStatus(); } if (!handle.isClosed) { closeHandle(handle.fileHandle); } } finally { handle.isClosed = true; } } }