@Override protected ExecutionOutput performExecute() { logger.info("execute called on this command: [" + this + "]"); //$NON-NLS-1$ //$NON-NLS-2$ // Don't need to do anything on execute except remember the // fileChunkHeader Id this.fileChunkHeader = ((FileChunkHeader) executionContext.get(ExecutionContext.FILE_CHUNK_HEADER)); this.fileChunkHeaderId = fileChunkHeader.getId(); return new ExecutionOutput(); }
.get(ExecutionContext.BASE_FILE_TRANSFER_MAPPED_RECORD);
/** * (non-Javadoc) * @see org.ikasan.connector.basefiletransfer.outbound.command.AbstractBaseFileTransferTransactionalResourceCommand#performExecute() */ @Override protected ExecutionOutput performExecute() throws ResourceException { logger.info("execute called on this command: [" + this + "]"); //$NON-NLS-1$ //$NON-NLS-2$ ClientListEntry entry = (ClientListEntry) executionContext.get(ExecutionContext.RETRIEVABLE_FILE_PARAM); //sourcePath = entry.getUri().getPath(); // We change the path to be file based as opposed to URI based, // means that root starts as '/' as opposed to '//' which // some FTP servers don't like String uriPath = entry.getUri().getPath(); File path = new File(uriPath); sourcePath = path.getPath(); BaseFileTransferMappedRecord record = getFile(entry); String clientId = (String) executionContext.get(ExecutionContext.CLIENT_ID); logger.debug("got clientId [" + clientId + "]"); //$NON-NLS-1$ //$NON-NLS-2$ entry.setClientId(clientId); dao.persistClientListEntry(entry); return new ExecutionOutput(record); }
@Override protected ExecutionOutput performExecute() throws ResourceException { logger.info("execute called on this command: [" + this + "]"); //$NON-NLS-1$ //$NON-NLS-2$ ClientListEntry entry = (ClientListEntry) executionContext.get(ExecutionContext.RETRIEVABLE_FILE_PARAM); this.sourcePath = entry.getUri().getPath(); File file = new File(entry.getUri().getPath()); try { String directory = file.getParent() + "/"; chunker.chunkFile(directory, file.getName(), chunkSize); } catch (ChunkException e) { throw new ResourceException("Exception caught whilst trying to chunk", e); //$NON-NLS-1$ } FileChunkHeader fileChunkHeader = ((ChunkerImpl) chunker).getFileChunkHeader(); clientId = (String) executionContext.get(ExecutionContext.CLIENT_ID); entry.setClientId(clientId); dao.persistClientListEntry(entry); return new ExecutionOutput(fileChunkHeader); }
for (ClientListEntry entry : filteredFiles) clientId = (String) this.executionContext.get(ExecutionContext.CLIENT_ID); entry.setClientId(clientId);