public void sourceChunkableData(String remoteDir, String fileName, OutputStream outputStream, long offset) throws ChunkableDataSourceException { try { if (offset > 0) { // TODO Remove hard coded '1' and replace with value that means RESUME getClient().get(remoteDir + fileName, outputStream, 1, offset); } else { getClient().get(remoteDir + fileName, outputStream); } } catch (ClientCommandGetException e) { throw new ChunkableDataSourceException("Exception whilst performing file transfer get ", e); //$NON-NLS-1$ } }
/** * Get the SFYPMapped record that is a representation of the file * * @param filePath The path to the file * @return The BaseFileTransferMappedRecord representing the file * @throws ResourceException - failure to perform get */ protected BaseFileTransferMappedRecord getFile(String filePath) throws ResourceException { if(logger.isDebugEnabled()) { logger.debug("getFile called with: [" + filePath + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } try { return getClient().get(filePath); } catch (ClientCommandGetException e) { logger.warn("Underlying File Transfer operation failed [GET]!", e); //$NON-NLS-1$ throw new ResourceException(e); } }
/** * Get the Mapped record that is a representation of the file * * @param entry A wrapper that holds the information we need to get the file * @return The BaseFileTransferMappedRecord representing the file * @throws ResourceException failure to perform get */ protected BaseFileTransferMappedRecord getFile(ClientListEntry entry) throws ResourceException { if(logger.isDebugEnabled()) { // logger.debug("getFile called with: [" + entry + "]"); //$NON-NLS-1$ //$NON-NLS-2$ logger.debug("Getting file [" + entry.getUri().getPath() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } try { return getClient().get(entry); } catch (ClientCommandGetException e) { logger.warn("Underlying File Transfer operation failed [GET]!", e); //$NON-NLS-1$ throw new ResourceException(e); } }