public void get(String filePath, OutputStream outputStream, int resume, long offset) throws ClientCommandGetException { throw new ClientCommandGetException("Not yet implemented"); //$NON-NLS-1$ }
public void get(String filePath, OutputStream outputStream, int resume, long offset) throws ClientCommandGetException { throw new ClientCommandGetException("Not yet implemented"); //$NON-NLS-1$ }
/** * OutputStream is closed by the caller * * @param filePath The path to the file that we're getting * @param outputStream The stream we're getting the file with * @throws ClientCommandGetException Exception if we could not get the file */ public void get(String filePath, OutputStream outputStream) throws ClientCommandGetException { logger.debug("get called with filePath [" + filePath + "] and outputStream [" + outputStream + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ try { if(!ftpClient.retrieveFile(filePath, outputStream)) { throw new ClientCommandGetException(); } } catch (IOException e) { throw new ClientCommandGetException(e); } }
/** * OutputStream is closed by the caller * * @param filePath The path to the file that we're getting * @param outputStream The stream we're getting the file with * @throws ClientCommandGetException Exception if we could not get the file */ public void get(String filePath, OutputStream outputStream) throws ClientCommandGetException { logger.debug("get called with filePath [" + filePath + "] and outputStream [" + outputStream + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ try { if(!ftpClient.retrieveFile(filePath, outputStream)) { throw new ClientCommandGetException(); } } catch (IOException e) { throw new ClientCommandGetException(e); } }
public InputStream getAsInputStream(String filePath) throws ClientCommandGetException { InputStream input = null; try { input = ftpClient.retrieveFileStream(filePath); if(input == null) { throw new ClientCommandGetException("InputStream for [" + filePath + "] was null."); } // Apache recommends using completePendingCommand() after // retrieveFileStream() if(!ftpClient.completePendingCommand()) { throw new ClientCommandGetException("Error trying to complete pending command."); } return input; } catch (IOException e) { throw new ClientCommandGetException(e); } }
public InputStream getAsInputStream(String filePath) throws ClientCommandGetException { InputStream input = null; try { input = ftpClient.retrieveFileStream(filePath); if(input == null) { throw new ClientCommandGetException("InputStream for [" + filePath + "] was null."); } // Apache recommends using completePendingCommand() after // retrieveFileStream() if(!ftpClient.completePendingCommand()) { throw new ClientCommandGetException("Error trying to complete pending command."); } return input; } catch (IOException e) { throw new ClientCommandGetException(e); } }
public BaseFileTransferMappedRecord get(String filePath) throws ClientCommandGetException { URI uri; BaseFileTransferMappedRecord record = null; ByteArrayOutputStream output = new ByteArrayOutputStream(); try { uri = new URI(filePath); try { logger.debug("getting file from filepath: [" + filePath + "]"); //$NON-NLS-1$ //$NON-NLS-2$ if(!this.ftpClient.retrieveFile(filePath, output)) { throw new ClientCommandGetException("Failed to get file from [" + filePath + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } record = BaseFileTransferUtils.createBaseFileTransferMappedRecord(uri, output); output.close(); } catch (IOException e) { throw new ClientCommandGetException("Failed to get file from [" + filePath + "]", e); //$NON-NLS-1$ //$NON-NLS-2$ } } catch (URISyntaxException e) { throw new ClientCommandGetException("could not create URI from filePath", e); //$NON-NLS-1$ } return record; }
public BaseFileTransferMappedRecord get(String filePath) throws ClientCommandGetException { URI uri; BaseFileTransferMappedRecord record = null; ByteArrayOutputStream output = new ByteArrayOutputStream(); try { uri = new URI(filePath); try { logger.debug("getting file from filepath: [" + filePath + "]"); //$NON-NLS-1$ //$NON-NLS-2$ if(!this.ftpClient.retrieveFile(filePath, output)) { throw new ClientCommandGetException("Failed to get file from [" + filePath + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } record = BaseFileTransferUtils.createBaseFileTransferMappedRecord(uri, output); output.close(); } catch (IOException e) { throw new ClientCommandGetException("Failed to get file from [" + filePath + "]", e); //$NON-NLS-1$ //$NON-NLS-2$ } } catch (URISyntaxException e) { throw new ClientCommandGetException("could not create URI from filePath", e); //$NON-NLS-1$ } return record; }
/** * Utilises the underlying API to return an InputStream as the result of the * GET operation * * @param filePath * @return InputStream * * @throws ClientCommandGetException */ public InputStream getAsInputStream(String filePath) throws ClientCommandGetException { try { return channelSftp.get(filePath); } catch (SftpException e) { throw new ClientCommandGetException(e); } }
/** * Utilises the underlying API to provide a GET implementation that delivers * its result into a supplied OutputStream * * @param filePath * @param outputStream * * @throws ClientCommandGetException */ public void get(String filePath, OutputStream outputStream) throws ClientCommandGetException { logger.debug("get called with filePath [" + filePath + "] and outputStream [" + outputStream + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ try { channelSftp.get(filePath, outputStream); } catch (SftpException e) { throw new ClientCommandGetException(e); } }
/** * Utilises the underlying API to provide a GET implementation that delivers * its result into a supplied OutputStream, resuming at the specified offset * of the target file * * @param filePath * @param outputStream * @param resume * @param offset * @throws ClientCommandGetException */ public void get(String filePath, OutputStream outputStream, int resume, long offset) throws ClientCommandGetException { SftpProgressMonitor monitor = null; try { channelSftp.get(filePath, outputStream, monitor, resume, offset); } catch (SftpException e) { throw new ClientCommandGetException(e); } }
throw new ClientCommandGetException("Failed to get file from sftp [" + filePath + "]", e); //$NON-NLS-1$ //$NON-NLS-2$ throw new ClientCommandGetException("could not create URI from filePath", e); //$NON-NLS-1$
public BaseFileTransferMappedRecord get(ClientListEntry clientListEntry) throws ClientCommandGetException { // Construct file path and get the file into an // BaseFileTransferMappedRecord URI uri = clientListEntry.getUri(); File srcFile = new File((uri).getPath()); logger.debug("Getting file [" + srcFile.getPath() + "] into an BaseFileTransferMappedRecord"); //$NON-NLS-1$ //$NON-NLS-2$ // Getting the file content ByteArrayOutputStream output = new ByteArrayOutputStream(); String fileName = srcFile.getName(); BaseFileTransferMappedRecord record = null; try { if(!this.ftpClient.retrieveFile(fileName, output)) { throw new ClientCommandGetException("Failed to get file [" + fileName //$NON-NLS-1$ + "] from directory [" + uri.getPath()); //$NON-NLS-1$ } record = BaseFileTransferUtils.createBaseFileTransferMappedRecord(uri, output); output.close(); } catch (IOException e) { throw new ClientCommandGetException("Failed to get file [" + fileName //$NON-NLS-1$ + "] from directory [" + uri.getPath(), e); //$NON-NLS-1$ } return record; }
public BaseFileTransferMappedRecord get(ClientListEntry clientListEntry) throws ClientCommandGetException { // Construct file path and get the file into an // BaseFileTransferMappedRecord URI uri = clientListEntry.getUri(); File srcFile = new File((uri).getPath()); logger.debug("Getting file [" + srcFile.getPath() + "] into an BaseFileTransferMappedRecord"); //$NON-NLS-1$ //$NON-NLS-2$ // Getting the file content ByteArrayOutputStream output = new ByteArrayOutputStream(); String fileName = srcFile.getName(); BaseFileTransferMappedRecord record = null; try { if(!this.ftpClient.retrieveFile(fileName, output)) { throw new ClientCommandGetException("Failed to get file [" + fileName //$NON-NLS-1$ + "] from directory [" + uri.getPath()); //$NON-NLS-1$ } record = BaseFileTransferUtils.createBaseFileTransferMappedRecord(uri, output); output.close(); } catch (IOException e) { throw new ClientCommandGetException("Failed to get file [" + fileName //$NON-NLS-1$ + "] from directory [" + uri.getPath(), e); //$NON-NLS-1$ } return record; }
if(input == null) throw new ClientCommandGetException("Failed to get file [" + srcFile.getName() //$NON-NLS-1$ + "] from directory [" + currentDir + "]"); //$NON-NLS-1$//$NON-NLS-2$ throw new ClientCommandGetException("Failed to complete the get command."); //$NON-NLS-1$ throw new ClientCommandGetException("Failed to get file [" + srcFile.getName() //$NON-NLS-1$ + "] from directory [" + currentDir + "]", e); //$NON-NLS-1$//$NON-NLS-2$
if(input == null) throw new ClientCommandGetException("Failed to get file [" + srcFile.getName() //$NON-NLS-1$ + "] from directory [" + currentDir + "]"); //$NON-NLS-1$//$NON-NLS-2$ throw new ClientCommandGetException("Failed to complete the get command."); //$NON-NLS-1$ throw new ClientCommandGetException("Failed to get file [" + srcFile.getName() //$NON-NLS-1$ + "] from directory [" + currentDir + "]", e); //$NON-NLS-1$//$NON-NLS-2$
throw new ClientCommandGetException(e1); throw new ClientCommandGetException(sb.toString(), e);
throw new ClientCommandGetException(e1); throw new ClientCommandGetException(sb.toString(), e);
sb.append(mode); sb.append("]. Available modes are OVERWRITE(1), RESUME(2) and APPEND(3)."); //$NON-NLS-1$ throw new ClientCommandGetException(sb.toString()); sb.append(']'); throw new ClientCommandGetException(sb.toString(), e); sb.append(']'); throw new ClientCommandGetException(sb.toString(), e); throw new ClientCommandGetException(e); throw new ClientCommandGetException(e); throw new ClientCommandGetException(e); throw new ClientCommandGetException(e); throw new ClientCommandGetException(msg, e);