throw new ClientCommandCdException(e1); throw new ClientCommandCdException(sb.toString(), e);
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 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$ } }