mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 14:25:37 +02:00
[198272] FTP should return classification for symbolic links so they show a link overlay
This commit is contained in:
parent
cfd90b9336
commit
4f92ce3fba
3 changed files with 34 additions and 11 deletions
|
@ -18,6 +18,7 @@
|
|||
* Javier Montalvo Orus (Symbian) - Fixing 161238 - [ftp] connections to VMS servers are not usable
|
||||
* Javier Montalvo Orus (Symbian) - Fixing 176216 - [api] FTP sould provide API to allow clients register their own FTPListingParser
|
||||
* Javier Montalvo Orus (Symbian) - [197758] Unix symbolic links are not classified as file vs. folder
|
||||
* Javier Montalvo Orus (Symbian) - [198272] FTP should return classification for symbolic links so they show a link overlay
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.services.files.ftp;
|
||||
|
@ -95,7 +96,7 @@ public class FTPHostFile implements IHostFile
|
|||
return !(_isDirectory || _isRoot);
|
||||
}
|
||||
|
||||
public boolean isSymbolicLink()
|
||||
public boolean isLink()
|
||||
{
|
||||
return _isLink;
|
||||
}
|
||||
|
@ -247,4 +248,33 @@ public class FTPHostFile implements IHostFile
|
|||
_isDirectory = isDirectory;
|
||||
}
|
||||
|
||||
public String getClassification() {
|
||||
String result;
|
||||
String linkTarget;
|
||||
|
||||
if (isLink()) {
|
||||
result = "symbolic link"; //$NON-NLS-1$
|
||||
if ((linkTarget = _ftpFile.getLink()) !=null) {
|
||||
if(isDirectory()) {
|
||||
result += "(directory):" + linkTarget; //$NON-NLS-1$
|
||||
} else if((getUserPermissions() & 0x01) == 0x01) {
|
||||
result += "(executable):" + linkTarget; //$NON-NLS-1$
|
||||
} else {
|
||||
result += "(file):" + linkTarget; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
} else if (isFile()) {
|
||||
if ((getUserPermissions() & 0x01) == 0x01) {
|
||||
result = "executable"; //$NON-NLS-1$
|
||||
} else {
|
||||
result = "file"; //$NON-NLS-1$
|
||||
}
|
||||
} else if (isDirectory()) {
|
||||
result = "directory"; //$NON-NLS-1$
|
||||
} else {
|
||||
result = "unknown"; //default-fallback //$NON-NLS-1$
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -516,7 +516,7 @@ public class FTPService extends AbstractFileService implements IFileService, IFT
|
|||
FTPHostFile f = new FTPHostFile(parentPath, _ftpFiles[i]);
|
||||
String name = f.getName();
|
||||
|
||||
if(f.isSymbolicLink()) {
|
||||
if(f.isLink()) {
|
||||
if(name.indexOf('.')==-1) {
|
||||
//modify FTPHostFile to be shown as a folder
|
||||
f.setIsDirectory(true);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
* Javier Montalvo Orus (Symbian) - [198272] FTP should return classification for symbolic links so they show a link overlay
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.subsystems.files.ftp.model;
|
||||
|
@ -48,14 +48,7 @@ public class FTPRemoteFile extends AbstractRemoteFile
|
|||
|
||||
public String getClassification()
|
||||
{
|
||||
if (isFile())
|
||||
{
|
||||
return "file"; //$NON-NLS-1$
|
||||
}
|
||||
else
|
||||
{
|
||||
return "directory"; //$NON-NLS-1$
|
||||
}
|
||||
return _ftpHostFile.getClassification();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue