mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +02:00
[164304] [ftp] cannot connect to wftpd server on Windows
This commit is contained in:
parent
58e0741aaa
commit
63318071eb
1 changed files with 29 additions and 13 deletions
|
@ -31,6 +31,7 @@
|
||||||
* Javier Montalvo Orus (Symbian) - Fixing 164009 - FTP connection shows as connected when login fails
|
* Javier Montalvo Orus (Symbian) - Fixing 164009 - FTP connection shows as connected when login fails
|
||||||
* Javier Montalvo Orus (Symbian) - Fixing 164306 - [ftp] FTP console shows plaintext passwords
|
* Javier Montalvo Orus (Symbian) - Fixing 164306 - [ftp] FTP console shows plaintext passwords
|
||||||
* Javier Montalvo Orus (Symbian) - Fixing 161238 - [ftp] connections to VMS servers are not usable
|
* Javier Montalvo Orus (Symbian) - Fixing 161238 - [ftp] connections to VMS servers are not usable
|
||||||
|
* Javier Montalvo Orus (Symbian) - Fixing 164304 - [ftp] cannot connect to wftpd server on Windows
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.services.files.ftp;
|
package org.eclipse.rse.services.files.ftp;
|
||||||
|
@ -308,9 +309,11 @@ public class FTPService extends AbstractFileService implements IFileService, IFT
|
||||||
|
|
||||||
for (int i = 0; i < _ftpFiles.length; i++)
|
for (int i = 0; i < _ftpFiles.length; i++)
|
||||||
{
|
{
|
||||||
if(_ftpFiles[i].getName().equalsIgnoreCase(fileName))
|
FTPHostFile tempFile = new FTPHostFile(remoteParent,_ftpFiles[i],_systemName);
|
||||||
|
|
||||||
|
if(tempFile.getName().equalsIgnoreCase(fileName))
|
||||||
{
|
{
|
||||||
file = new FTPHostFile(remoteParent,_ftpFiles[i],_systemName);
|
file = tempFile;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,7 +403,15 @@ public class FTPService extends AbstractFileService implements IFileService, IFT
|
||||||
|
|
||||||
public String getSeparator()
|
public String getSeparator()
|
||||||
{
|
{
|
||||||
return "/"; //$NON-NLS-1$
|
String separator = "/"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
if(_systemName.equals(FTPClientConfig.SYST_NT))
|
||||||
|
{
|
||||||
|
separator = "\\"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
|
return separator;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -665,24 +676,26 @@ public class FTPService extends AbstractFileService implements IFileService, IFT
|
||||||
*/
|
*/
|
||||||
public boolean rename(IProgressMonitor monitor, String remoteParent, String oldName, String newName) throws SystemMessageException {
|
public boolean rename(IProgressMonitor monitor, String remoteParent, String oldName, String newName) throws SystemMessageException {
|
||||||
|
|
||||||
|
boolean success = false;
|
||||||
|
|
||||||
FTPClient ftpClient = getFTPClient();
|
FTPClient ftpClient = getFTPClient();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if(remoteParent.endsWith("/") || remoteParent.endsWith("\\")) //$NON-NLS-1$ //$NON-NLS-2$
|
String source = remoteParent.endsWith(getSeparator()) ? remoteParent + oldName : remoteParent + getSeparator() + oldName;
|
||||||
|
|
||||||
|
success = ftpClient.rename(source, newName);
|
||||||
|
|
||||||
|
if(!success)
|
||||||
{
|
{
|
||||||
ftpClient.rename(remoteParent + oldName, newName);
|
throw new Exception(ftpClient.getReplyString());
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ftpClient.rename(remoteParent + getSeparator() + oldName, newName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RemoteFileIOException(e);
|
throw new RemoteFileIOException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -707,7 +720,10 @@ public class FTPService extends AbstractFileService implements IFileService, IFT
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
success = ftpClient.rename(srcParent + getSeparator() + srcName, tgtParent + getSeparator() + tgtName);
|
String source = srcParent.endsWith(getSeparator()) ? srcParent + srcName : srcParent + getSeparator() + srcName;
|
||||||
|
String target = tgtParent.endsWith(getSeparator()) ? tgtParent + tgtName : tgtParent + getSeparator() + tgtName;
|
||||||
|
|
||||||
|
success = ftpClient.rename(source, target);
|
||||||
|
|
||||||
if(!success)
|
if(!success)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue