@Override public Exchange createExchange(GenericFile<T> file) { Exchange answer = super.createExchange(); if (file != null) { file.bindToExchange(answer); } return answer; }
@Override @SuppressWarnings("unchecked") public RemoteFileEndpoint<T> getEndpoint() { return (RemoteFileEndpoint<T>) super.getEndpoint(); }
@Override public void changeCurrentDirectory(String path) throws GenericFileOperationFailedException { throw new GenericFileOperationFailedException("Operation 'cd " + path + "' not supported by the scp: protocol"); }
private void configureBulkRequests() { try { tryConfigureBulkRequests(); } catch (JSchException e) { throw new GenericFileOperationFailedException("Failed to configure number of bulk requests", e); } }
/** * Populates the {@link GenericFileMessage} relevant headers * * @param message the message to populate with headers */ public void populateHeaders(GenericFileMessage<T> message) { if (message != null) { // because there is not probeContentType option // in other file based components, false may be passed // as the second argument. super.populateHeaders(message, false); message.setHeader("CamelFileHost", getHostname()); } }
public static File getFile(GenericFile file) { return (File) file.getBody(); }
protected boolean pollSubDirectory(String absolutePath, String dirName, List<GenericFile<FTPFile>> fileList, int depth) { boolean answer = doSafePollSubDirectory(absolutePath, dirName, fileList, depth); // change back to parent directory when finished polling sub directory if (isStepwise()) { operations.changeToParentDirectory(); } return answer; }
protected boolean pollSubDirectory(String absolutePath, String dirName, List<GenericFile<SftpRemoteFile>> fileList, int depth) { boolean answer = doSafePollSubDirectory(absolutePath, dirName, fileList, depth); // change back to parent directory when finished polling sub directory if (isStepwise()) { operations.changeToParentDirectory(); } return answer; }
private boolean isUseList() { RemoteFileConfiguration config = (RemoteFileConfiguration) endpoint.getConfiguration(); return config.isUseList(); }
private boolean isStepwise() { RemoteFileConfiguration config = (RemoteFileConfiguration) endpoint.getConfiguration(); return config.isStepwise(); }
@Override protected void doStop() throws Exception { super.doStop(); disconnect(); }
@Override @SuppressWarnings("unchecked") public RemoteFileEndpoint<T> getEndpoint() { return (RemoteFileEndpoint<T>) super.getEndpoint(); }
@Override protected void doStart() throws Exception { log.debug("Starting"); // do not connect when component starts, just wait until we process as we will // connect at that time if needed super.doStart(); }
@Override protected Map<String, Object> getParamsAsMap() { Map<String, Object> map = super.getParamsAsMap(); map.put("fastExistsCheck", fastExistsCheck); return map; }
@Override public List<ScpFile> listFiles(String path) throws GenericFileOperationFailedException { throw new GenericFileOperationFailedException("Operation 'ls " + path + "' not supported by the scp: protocol"); }
private boolean isUseList() { RemoteFileConfiguration config = (RemoteFileConfiguration) endpoint.getConfiguration(); return config.isUseList(); }
@Override public boolean renameFile(String from, String to) throws GenericFileOperationFailedException { throw new GenericFileOperationFailedException("Operation 'rename' not supported by the scp: protocol"); }
@Override public void changeToParentDirectory() throws GenericFileOperationFailedException { throw new GenericFileOperationFailedException("Operation 'cd ..' not supported by the scp: protocol"); }
@Override public boolean deleteFile(String name) throws GenericFileOperationFailedException { throw new GenericFileOperationFailedException("Operation 'delete' not supported by the scp: protocol"); }
@Override public List<ScpFile> listFiles() throws GenericFileOperationFailedException { throw new GenericFileOperationFailedException("Operation 'ls' not supported by the scp: protocol"); }