1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +02:00

[187531] Improve exception thrown when Login Failed on FTP

This commit is contained in:
Javier Montalvo Orus 2007-05-25 12:56:14 +00:00
parent 3a84f109bf
commit 934bcf1e0f
2 changed files with 14 additions and 7 deletions

View file

@ -41,6 +41,7 @@
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Javier Montalvo Orus (Symbian) - improved autodetection of FTPListingParser
* Javier Montalvo Orus (Symbian) - [187096] Drag&Drop + Copy&Paste shows error message on FTP connection
* Javier Montalvo Orus (Symbian) - [187531] Improve exception thrown when Login Failed on FTP
********************************************************************************/
package org.eclipse.rse.internal.services.files.ftp;
@ -77,6 +78,7 @@ import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.services.files.IHostFile;
import org.eclipse.rse.services.files.RemoteFileCancelledException;
import org.eclipse.rse.services.files.RemoteFileIOException;
import org.eclipse.rse.services.files.RemoteFileSecurityException;
import org.eclipse.rse.services.files.RemoteFolderNotEmptyException;
public class FTPService extends AbstractFileService implements IFileService, IFTPService
@ -235,7 +237,7 @@ public class FTPService extends AbstractFileService implements IFileService, IFT
_entryParserFactory = entryParserFactory;
}
public void connect() throws Exception
public void connect() throws RemoteFileSecurityException,IOException
{
if (_ftpClient == null)
@ -277,14 +279,14 @@ public class FTPService extends AbstractFileService implements IFileService, IFT
{
String lastMessage = _ftpClient.getReplyString();
disconnect();
throw new Exception(lastMessage);
throw new RemoteFileSecurityException(new Exception(lastMessage));
}
}
else if(!FTPReply.isPositiveCompletion(userReply))
{
String lastMessage = _ftpClient.getReplyString();
disconnect();
throw new Exception(lastMessage);
throw new RemoteFileSecurityException(new Exception(lastMessage));
}
//System parser

View file

@ -17,10 +17,12 @@
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
* Martin Oberhuber (Wind River) - [cleanup] move FTPSubsystemResources out of core
* Javier Montalvo Orus (Symbian) - Fixing 176216 - [api] FTP sould provide API to allow clients register their own FTPListingParser
* Javier Montalvo Orus (Symbian) - [187531] Improve exception thrown when Login Failed on FTP
********************************************************************************/
package org.eclipse.rse.internal.subsystems.files.ftp.connectorservice;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
@ -30,9 +32,10 @@ import org.eclipse.rse.core.model.IPropertySet;
import org.eclipse.rse.core.model.PropertyType;
import org.eclipse.rse.core.model.SystemSignonInformation;
import org.eclipse.rse.internal.services.files.ftp.FTPService;
import org.eclipse.rse.internal.subsystems.files.ftp.parser.FTPClientConfigFactory;
import org.eclipse.rse.internal.subsystems.files.ftp.FTPSubsystemResources;
import org.eclipse.rse.internal.subsystems.files.ftp.parser.FTPClientConfigFactory;
import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.services.files.RemoteFileException;
import org.eclipse.rse.ui.subsystems.StandardConnectorService;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
@ -73,12 +76,12 @@ public class FTPConnectorService extends StandardConnectorService
}
}
protected void internalConnect(IProgressMonitor monitor) throws Exception
protected void internalConnect(IProgressMonitor monitor) throws RemoteFileException, IOException
{
internalConnect();
}
private void internalConnect() throws Exception
private void internalConnect() throws RemoteFileException, IOException
{
SystemSignonInformation info = getSignonInformation();
@ -91,7 +94,9 @@ public class FTPConnectorService extends StandardConnectorService
_ftpService.setFTPClientConfigFactory(FTPClientConfigFactory.getParserFactory());
_ftpService.connect();
_ftpService.connect();
}
private OutputStream getLoggingStream(String hostName,int portNumber)