@Override protected boolean pollDirectory(String fileName, List<GenericFile<FTPFile>> fileList, int depth) { String currentDir = null; if (isStepwise()) { // must remember current dir so we stay in that directory after the poll currentDir = operations.getCurrentDirectory(); } // strip trailing slash fileName = FileUtil.stripTrailingSeparator(fileName); boolean answer = doPollDirectory(fileName, null, fileList, depth); if (currentDir != null) { operations.changeCurrentDirectory(currentDir); } return answer; }
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; }
if (dir != null) { operations.buildDirectory(dir, false); if (operations.existsFile(to)) { if (endpoint.isEagerDeleteTargetFile()) { LOG.trace("Deleting existing file: {}", to); operations.deleteFile(to); } else { throw new GenericFileOperationFailedException("Cannot move existing file from: " + fileName + " to: " + to + " as there already exists a file: " + to); if (!operations.renameFile(fileName, to)) { throw new GenericFileOperationFailedException("Cannot rename file from: " + fileName + " to: " + to);
if (dir != null) { operations.buildDirectory(dir, false); if (operations.existsFile(to)) { if (endpoint.isEagerDeleteTargetFile()) { LOG.trace("Deleting existing file: {}", to); if (!operations.renameFile(fileName, to)) { throw new GenericFileOperationFailedException("Cannot rename file from: " + fileName + " to: " + to);
if (isStepwise()) { dir = ObjectHelper.isNotEmpty(dirName) ? dirName : absolutePath; operations.changeCurrentDirectory(dir); } else { dir = absolutePath; if (isUseList()) { if (isStepwise()) { files = operations.listFiles(); } else { files = operations.listFiles(dir);
@Override protected void doStart() throws Exception { // turn off scheduler first, so autoCreate is handled before scheduler starts boolean startScheduler = isStartScheduler(); setStartScheduler(false); try { super.doStart(); if (endpoint.isAutoCreate()) { log.debug("Auto creating directory: {}", endpoint.getConfiguration().getDirectory()); try { connectIfNecessary(); operations.buildDirectory(endpoint.getConfiguration().getDirectory(), true); } catch (GenericFileOperationFailedException e) { // log a WARN as we want to start the consumer. log.warn("Error auto creating directory: " + endpoint.getConfiguration().getDirectory() + " due " + e.getMessage() + ". This exception is ignored.", e); } } } finally { if (startScheduler) { setStartScheduler(true); startScheduler(); } } }
files = operations.listFiles(); } else { LOG.trace("Using fast exists to update file information for {}", path); files = operations.listFiles(path); files = operations.listFiles(); } else { LOG.trace("Using full directory listing to update file information for {}. Consider enabling fastExistsCheck option.", path); files = operations.listFiles(path);
if (isStepwise()) { dir = ObjectHelper.isNotEmpty(dirName) ? dirName : absolutePath; operations.changeCurrentDirectory(dir); } else { dir = absolutePath; if (isUseList()) { if (isStepwise()) { files = operations.listFiles(); } else { files = operations.listFiles(dir);
@Override protected void doStart() throws Exception { // turn off scheduler first, so autoCreate is handled before scheduler starts boolean startScheduler = isStartScheduler(); setStartScheduler(false); try { super.doStart(); if (endpoint.isAutoCreate()) { log.debug("Auto creating directory: {}", endpoint.getConfiguration().getDirectory()); try { connectIfNecessary(); operations.buildDirectory(endpoint.getConfiguration().getDirectory(), true); } catch (GenericFileOperationFailedException e) { // log a WARN as we want to start the consumer. log.warn("Error auto creating directory: " + endpoint.getConfiguration().getDirectory() + " due " + e.getMessage() + ". This exception is ignored.", e); } } } finally { if (startScheduler) { setStartScheduler(true); startScheduler(); } } }
files = operations.listFiles(); } else { LOG.trace("Using fast exists to update file information for {}", path); files = operations.listFiles(path); files = operations.listFiles(); } else { LOG.trace("Using full directory listing to update file information for {}. Consider enabling fastExistsCheck option.", path); files = operations.listFiles(path);
@Override protected boolean pollDirectory(String fileName, List<GenericFile<SftpRemoteFile>> fileList, int depth) { String currentDir = null; if (isStepwise()) { // must remember current dir so we stay in that directory after the poll currentDir = operations.getCurrentDirectory(); } // strip trailing slash fileName = FileUtil.stripTrailingSeparator(fileName); boolean answer = doPollDirectory(fileName, null, fileList, depth); if (currentDir != null) { operations.changeCurrentDirectory(currentDir); } 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; }