1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 04:55:22 +02:00

[235463][ftp][dstore] Incorrect case sensitivity reported on windows-remote

This commit is contained in:
Martin Oberhuber 2008-06-03 21:12:00 +00:00
parent f02280993f
commit 7fd4ac6495
4 changed files with 71 additions and 57 deletions

View file

@ -45,6 +45,7 @@
* David McKnight (IBM) - [229610] [api] File transfers should use workspace text file encoding * David McKnight (IBM) - [229610] [api] File transfers should use workspace text file encoding
* David McKnight (IBM) - [221211] [api][breaking][files] need batch operations to indicate which operations were successful * David McKnight (IBM) - [221211] [api][breaking][files] need batch operations to indicate which operations were successful
* Radoslav Gerganov (ProSyst) - [230919] IFileService.delete() should not return a boolean * Radoslav Gerganov (ProSyst) - [230919] IFileService.delete() should not return a boolean
* Martin Oberhuber (Wind River) - [235463][ftp][dstore] Incorrect case sensitivity reported on windows-remote
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.services.dstore.files; package org.eclipse.rse.internal.services.dstore.files;
@ -2023,7 +2024,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
public boolean isCaseSensitive() public boolean isCaseSensitive()
{ {
return true; return this.unixStyle;
} }
public void setLastModified(String parent, String name, public void setLastModified(String parent, String name,

View file

@ -76,6 +76,7 @@
* Radoslav Gerganov (ProSyst) - [230919] IFileService.delete() should not return a boolean * Radoslav Gerganov (ProSyst) - [230919] IFileService.delete() should not return a boolean
* Martin Oberhuber (Wind River) - [218040] FTP should support permission modification * Martin Oberhuber (Wind River) - [218040] FTP should support permission modification
* Martin Oberhuber (Wind River) - [234045] FTP Permission Error Handling * Martin Oberhuber (Wind River) - [234045] FTP Permission Error Handling
* Martin Oberhuber (Wind River) - [235463][ftp][dstore] Incorrect case sensitivity reported on windows-remote
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.services.files.ftp; package org.eclipse.rse.internal.services.files.ftp;
@ -137,6 +138,7 @@ public class FTPService extends AbstractFileService implements IFTPService, IFil
private Mutex _commandMutex = new Mutex(); private Mutex _commandMutex = new Mutex();
private String _userHome; private String _userHome;
private boolean _caseSensitive = true;
private transient String _hostName; private transient String _hostName;
private transient String _userId; private transient String _userId;
private transient String _password; private transient String _password;
@ -572,7 +574,7 @@ public class FTPService extends AbstractFileService implements IFTPService, IFil
*/ */
protected FTPHostFile getFileInternal(String remoteParent, String fileName, IProgressMonitor monitor) throws SystemMessageException protected FTPHostFile getFileInternal(String remoteParent, String fileName, IProgressMonitor monitor) throws SystemMessageException
{ {
remoteParent = checkEncoding(remoteParent); remoteParent = checkEncoding(remoteParent);
fileName = checkEncoding(fileName); fileName = checkEncoding(fileName);
if (monitor!=null){ if (monitor!=null){
if (monitor.isCanceled()) { if (monitor.isCanceled()) {
@ -603,50 +605,46 @@ public class FTPService extends AbstractFileService implements IFTPService, IFil
FTPHostFile file = null; FTPHostFile file = null;
if(_commandMutex.waitForLock(monitor, Long.MAX_VALUE)) if(_commandMutex.waitForLock(monitor, Long.MAX_VALUE))
{ {
try {
try{
//try to retrieve the file //try to retrieve the file
_ftpClient = getFTPClient(); _ftpClient = getFTPClient();
if(!_ftpClient.changeWorkingDirectory(remoteParent)) if(!_ftpClient.changeWorkingDirectory(remoteParent))
{ {
throw new RemoteFileIOException(new Exception(_ftpClient.getReplyString())); throw new RemoteFileIOException(new Exception(_ftpClient.getReplyString()));
} }
if(!listFiles(monitor)) if(!listFiles(monitor))
{ {
throw new SystemOperationCancelledException(); throw new SystemOperationCancelledException();
} }
synchronized(_fCachePreviousFiles) { synchronized (_fCachePreviousFiles) {
cacheFiles(remoteParent); cacheFiles(remoteParent);
//Bug 198645: try exact match first //Bug 198645: try exact match first
Object o = _fCachePreviousFiles.get(fileName); Object o = _fCachePreviousFiles.get(fileName);
if (o!=null) return (FTPHostFile)o; if (o!=null) return (FTPHostFile)o;
//try case insensitive match (usually never executed) //try case insensitive match (usually never executed)
if (!isCaseSensitive()) { if (!isCaseSensitive()) {
for (int i = 0; i < _ftpFiles.length; i++) { for (int i = 0; i < _ftpFiles.length; i++) {
String tempName = _ftpFiles[i].getName(); String tempName = _ftpFiles[i].getName();
if(tempName.equalsIgnoreCase(fileName)) { if (tempName.equalsIgnoreCase(fileName)) {
file = (FTPHostFile)_fCachePreviousFiles.get(tempName); file = (FTPHostFile) _fCachePreviousFiles.get(tempName);
break; break;
}
} }
} }
} }
}
// if not found, create new object with non-existing flag // if not found, create new object with non-existing flag
if(file == null) if(file == null)
{ {
file = new FTPHostFile(remoteParent,fileName, false, false, 0, 0, false); file = new FTPHostFile(remoteParent,fileName, false, false, 0, 0, false);
} }
} catch (Exception e) {
}catch (Exception e){
throw new RemoteFileIOException(e); throw new RemoteFileIOException(e);
} finally { } finally {
_commandMutex.release(); _commandMutex.release();
@ -1362,10 +1360,13 @@ public class FTPService extends AbstractFileService implements IFTPService, IFil
} }
} }
public void setIsCaseSensitive(boolean b) {
_caseSensitive = b;
}
public boolean isCaseSensitive() public boolean isCaseSensitive()
{ {
//TODO find out whether remote is case sensitive or not return _caseSensitive;
return true;
} }
/** /**

View file

@ -14,6 +14,7 @@
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* David Dykstal (IBM) - [222270] clean up interfaces in org.eclipse.rse.core.filters * David Dykstal (IBM) - [222270] clean up interfaces in org.eclipse.rse.core.filters
* Martin Oberhuber (Wind River) - [235463][ftp][dstore] Incorrect case sensitivity reported on windows-remote
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.subsystems.files.dstore; package org.eclipse.rse.subsystems.files.dstore;
@ -28,6 +29,12 @@ import org.eclipse.rse.ui.SystemBasePlugin;
public class DStoreWindowsFileSubSystemConfiguration extends DStoreFileSubSystemConfiguration public class DStoreWindowsFileSubSystemConfiguration extends DStoreFileSubSystemConfiguration
{ {
public DStoreWindowsFileSubSystemConfiguration() {
super();
_isWindows = true;
setIsUnixStyle(!_isWindows);
}
protected ISystemFilterPool createDefaultFilterPool(ISystemFilterPoolManager mgr) protected ISystemFilterPool createDefaultFilterPool(ISystemFilterPoolManager mgr)
{ {
ISystemFilterPool pool = null; ISystemFilterPool pool = null;

View file

@ -23,6 +23,7 @@
* David McKnight (IBM) - [196632] [ftp] Passive mode setting does not work * David McKnight (IBM) - [196632] [ftp] Passive mode setting does not work
* Martin Oberhuber (Wind River) - [204669] Fix ftp path concatenation on systems using backslash separator * Martin Oberhuber (Wind River) - [204669] Fix ftp path concatenation on systems using backslash separator
* Martin Oberhuber (Wind River) - [203500] Support encodings for FTP paths * Martin Oberhuber (Wind River) - [203500] Support encodings for FTP paths
* Martin Oberhuber (Wind River) - [235463][ftp][dstore] Incorrect case sensitivity reported on windows-remote
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.subsystems.files.ftp.connectorservice; package org.eclipse.rse.internal.subsystems.files.ftp.connectorservice;
@ -61,6 +62,10 @@ public class FTPConnectorService extends StandardConnectorService
{ {
super(FTPSubsystemResources.RESID_FTP_CONNECTORSERVICE_NAME,FTPSubsystemResources.RESID_FTP_CONNECTORSERVICE_DESCRIPTION, host, port); super(FTPSubsystemResources.RESID_FTP_CONNECTORSERVICE_NAME,FTPSubsystemResources.RESID_FTP_CONNECTORSERVICE_DESCRIPTION, host, port);
_ftpService = new FTPService(); _ftpService = new FTPService();
if (getHost().getSystemType().isWindows()) {
// Configured against a Windows-specific system type
_ftpService.setIsCaseSensitive(false);
}
getPropertySet(); getPropertySet();
} }