@Override public String getWorkingDirectory() throws IOException { return client.printWorkingDirectory(); }
@Override /** * * @return String directory retrieved for server on connect */ public String getDirectoryserver() throws IOException { return getFtpsClient().printWorkingDirectory(); }
public String pwd() throws ClientCommandPwdException { String currentDir = null; try { currentDir = this.ftpClient.printWorkingDirectory(); } catch (IOException e) { throw new ClientCommandPwdException("Failed to get working directory!", e); //$NON-NLS-1$ } return currentDir; }
public void cd(String targetPath) throws ClientCommandCdException { // This code is not quite ideal as printWorkingDirectory() could fail // but the net result is that the developer will be informed of the // fault regardless String currentDirectory = null; try { currentDirectory = this.ftpClient.printWorkingDirectory(); if(!this.ftpClient.changeWorkingDirectory(targetPath)) { throw new ClientCommandCdException("Failed to call directory [" + targetPath //$NON-NLS-1$ + "] from [" + currentDirectory + "]"); //$NON-NLS-1$//$NON-NLS-2$ } logger.debug("CD from [" + currentDirectory + "] to [" + this.ftpClient.printWorkingDirectory() + "]."); } catch (IOException e) { throw new ClientCommandCdException("Failed to call directory [" + targetPath //$NON-NLS-1$ + "] from [" + currentDirectory + "]", e); //$NON-NLS-1$//$NON-NLS-2$ } }
public void rename(String currentPath, String newPath) throws ClientCommandRenameException { logger.debug("rename called with currentPath [" + currentPath + "], newPath [" + newPath + "]"); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$ try { String dirBefore = this.ftpClient.printWorkingDirectory(); logger.debug("Working directory before rename = [" + dirBefore + "]"); //$NON-NLS-1$ //$NON-NLS-2$ logger.debug("Current Path = [" + currentPath + "]"); //$NON-NLS-1$ //$NON-NLS-2$ logger.debug("New Path = [" + newPath + "]"); //$NON-NLS-1$ //$NON-NLS-2$ if(!this.ftpClient.rename(currentPath, newPath)) { throw new ClientCommandRenameException("Failed to rename [" + currentPath + "] to [" + newPath + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } logger.debug("Successfully renamed [" + currentPath + "] to [" //$NON-NLS-1$ //$NON-NLS-2$ + newPath + "]"); //$NON-NLS-1$ String dirAfter = this.ftpClient.printWorkingDirectory(); logger.debug("Working directory after rename = [" + dirAfter + "]"); //$NON-NLS-1$ //$NON-NLS-2$ if(!dirBefore.equals(dirAfter)) { this.ftpClient.changeWorkingDirectory(dirBefore); logger.debug("Returning to previous working = [" + dirBefore + "]"); //$NON-NLS-1$//$NON-NLS-2$ } } catch (IOException e) { throw new ClientCommandRenameException("Failed to rename [" + currentPath + "] to [" + newPath + "]", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } }
try currentDir = this.ftpClient.printWorkingDirectory(); input = this.ftpClient.retrieveFileStream(srcFile.getName()); if(input == null)
try directoryParentPath = ftpClient.printWorkingDirectory();
try String startDir = this.ftpClient.printWorkingDirectory(); logger.debug("Start directory [" + startDir + "]."); if(!this.ftpClient.changeWorkingDirectory(path)) String currentDir = this.ftpClient.printWorkingDirectory(); list = convertFTPFiles(currentDir,ftpFiles); String currentDir = this.ftpClient.printWorkingDirectory(); logger.debug("Listing directory [" + currentDir + "]");
try cwd = this.ftpClient.printWorkingDirectory();