mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
[187531] Improve exception thrown when Login Failed on FTP
This commit is contained in:
parent
3a84f109bf
commit
934bcf1e0f
2 changed files with 14 additions and 7 deletions
|
@ -41,6 +41,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||||
* Javier Montalvo Orus (Symbian) - improved autodetection of FTPListingParser
|
* 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) - [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;
|
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.IHostFile;
|
||||||
import org.eclipse.rse.services.files.RemoteFileCancelledException;
|
import org.eclipse.rse.services.files.RemoteFileCancelledException;
|
||||||
import org.eclipse.rse.services.files.RemoteFileIOException;
|
import org.eclipse.rse.services.files.RemoteFileIOException;
|
||||||
|
import org.eclipse.rse.services.files.RemoteFileSecurityException;
|
||||||
import org.eclipse.rse.services.files.RemoteFolderNotEmptyException;
|
import org.eclipse.rse.services.files.RemoteFolderNotEmptyException;
|
||||||
|
|
||||||
public class FTPService extends AbstractFileService implements IFileService, IFTPService
|
public class FTPService extends AbstractFileService implements IFileService, IFTPService
|
||||||
|
@ -235,7 +237,7 @@ public class FTPService extends AbstractFileService implements IFileService, IFT
|
||||||
_entryParserFactory = entryParserFactory;
|
_entryParserFactory = entryParserFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void connect() throws Exception
|
public void connect() throws RemoteFileSecurityException,IOException
|
||||||
{
|
{
|
||||||
|
|
||||||
if (_ftpClient == null)
|
if (_ftpClient == null)
|
||||||
|
@ -277,14 +279,14 @@ public class FTPService extends AbstractFileService implements IFileService, IFT
|
||||||
{
|
{
|
||||||
String lastMessage = _ftpClient.getReplyString();
|
String lastMessage = _ftpClient.getReplyString();
|
||||||
disconnect();
|
disconnect();
|
||||||
throw new Exception(lastMessage);
|
throw new RemoteFileSecurityException(new Exception(lastMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!FTPReply.isPositiveCompletion(userReply))
|
else if(!FTPReply.isPositiveCompletion(userReply))
|
||||||
{
|
{
|
||||||
String lastMessage = _ftpClient.getReplyString();
|
String lastMessage = _ftpClient.getReplyString();
|
||||||
disconnect();
|
disconnect();
|
||||||
throw new Exception(lastMessage);
|
throw new RemoteFileSecurityException(new Exception(lastMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
//System parser
|
//System parser
|
||||||
|
|
|
@ -17,10 +17,12 @@
|
||||||
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
|
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
|
||||||
* Martin Oberhuber (Wind River) - [cleanup] move FTPSubsystemResources out of core
|
* 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) - 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;
|
package org.eclipse.rse.internal.subsystems.files.ftp.connectorservice;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.Arrays;
|
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.PropertyType;
|
||||||
import org.eclipse.rse.core.model.SystemSignonInformation;
|
import org.eclipse.rse.core.model.SystemSignonInformation;
|
||||||
import org.eclipse.rse.internal.services.files.ftp.FTPService;
|
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.FTPSubsystemResources;
|
||||||
|
import org.eclipse.rse.internal.subsystems.files.ftp.parser.FTPClientConfigFactory;
|
||||||
import org.eclipse.rse.services.files.IFileService;
|
import org.eclipse.rse.services.files.IFileService;
|
||||||
|
import org.eclipse.rse.services.files.RemoteFileException;
|
||||||
import org.eclipse.rse.ui.subsystems.StandardConnectorService;
|
import org.eclipse.rse.ui.subsystems.StandardConnectorService;
|
||||||
import org.eclipse.ui.console.ConsolePlugin;
|
import org.eclipse.ui.console.ConsolePlugin;
|
||||||
import org.eclipse.ui.console.IConsole;
|
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();
|
internalConnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void internalConnect() throws Exception
|
private void internalConnect() throws RemoteFileException, IOException
|
||||||
{
|
{
|
||||||
|
|
||||||
SystemSignonInformation info = getSignonInformation();
|
SystemSignonInformation info = getSignonInformation();
|
||||||
|
@ -91,7 +94,9 @@ public class FTPConnectorService extends StandardConnectorService
|
||||||
_ftpService.setFTPClientConfigFactory(FTPClientConfigFactory.getParserFactory());
|
_ftpService.setFTPClientConfigFactory(FTPClientConfigFactory.getParserFactory());
|
||||||
|
|
||||||
|
|
||||||
_ftpService.connect();
|
_ftpService.connect();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private OutputStream getLoggingStream(String hostName,int portNumber)
|
private OutputStream getLoggingStream(String hostName,int portNumber)
|
||||||
|
|
Loading…
Add table
Reference in a new issue