mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
[199394] Allow real files/folders containing String #virtual#
This commit is contained in:
parent
dbbf03eb95
commit
74e4204ffe
1 changed files with 30 additions and 30 deletions
|
@ -15,9 +15,10 @@
|
||||||
* Martin Oberhuber (Wind River) - fix 168586 - isCaseSensitive() on Windows
|
* Martin Oberhuber (Wind River) - fix 168586 - isCaseSensitive() on Windows
|
||||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||||
* Kevin Doyle (IBM) - [182221] Throwing Proper Exceptions on create file/folder
|
* Kevin Doyle (IBM) - [182221] Throwing Proper Exceptions on create file/folder
|
||||||
* Xuan Chen (IBM) - Fix 189487 - copy and paste a folder did not work - workbench hang
|
* Xuan Chen (IBM) - Fix 189487 - copy and paste a folder did not work - workbench hang
|
||||||
* David McKnight (IBM) - [192705] Exception needs to be thrown when rename fails
|
* David McKnight (IBM) - [192705] Exception needs to be thrown when rename fails
|
||||||
* Kevin Doyle (IBM) - [196211] Move a folder to a directory that contains a folder by that name errors
|
* Kevin Doyle (IBM) - [196211] Move a folder to a directory that contains a folder by that name errors
|
||||||
|
* Martin Oberhuber (Wind River) - [199394] Allow real files/folders containing String #virtual#
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.services.local.files;
|
package org.eclipse.rse.internal.services.local.files;
|
||||||
|
@ -622,20 +623,29 @@ public class LocalFileService extends AbstractFileService implements IFileServic
|
||||||
protected IHostFile[] internalFetch(String remoteParent, String fileFilter, int type, IProgressMonitor monitor) {
|
protected IHostFile[] internalFetch(String remoteParent, String fileFilter, int type, IProgressMonitor monitor) {
|
||||||
LocalFileNameFilter fFilter = new LocalFileNameFilter(fileFilter, type);
|
LocalFileNameFilter fFilter = new LocalFileNameFilter(fileFilter, type);
|
||||||
File localParent = new File(remoteParent);
|
File localParent = new File(remoteParent);
|
||||||
// if the system type is Windows, we get the canonical path so that we have the correct case in the path
|
boolean isArchive = false;
|
||||||
// this is needed because Windows paths are case insensitive
|
boolean isVirtual = false;
|
||||||
if (isWindows()) {
|
if (localParent.exists()) {
|
||||||
try {
|
if (localParent.isFile()) {
|
||||||
localParent = localParent.getCanonicalFile();
|
isArchive = ArchiveHandlerManager.getInstance().isArchive(localParent);
|
||||||
} catch (IOException e) {
|
}
|
||||||
System.out.println("Can not get canonical path: " + localParent.getAbsolutePath()); //$NON-NLS-1$
|
// if the system type is Windows, we get the canonical path so that we have the correct case in the path
|
||||||
|
// this is needed because Windows paths are case insensitive
|
||||||
|
if (isWindows()) {
|
||||||
|
try {
|
||||||
|
localParent = localParent.getCanonicalFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("Can not get canonical path: " + localParent.getAbsolutePath()); //$NON-NLS-1$
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (remoteParent.endsWith(ArchiveHandlerManager.VIRTUAL_SEPARATOR)) {
|
else {
|
||||||
remoteParent = remoteParent.substring(0, remoteParent.length() - ArchiveHandlerManager.VIRTUAL_SEPARATOR.length());
|
// does not exist: is it virtual?
|
||||||
|
if (remoteParent.endsWith(ArchiveHandlerManager.VIRTUAL_SEPARATOR)) {
|
||||||
|
remoteParent = remoteParent.substring(0, remoteParent.length() - ArchiveHandlerManager.VIRTUAL_SEPARATOR.length());
|
||||||
|
}
|
||||||
|
isVirtual = ArchiveHandlerManager.isVirtual(remoteParent);
|
||||||
}
|
}
|
||||||
boolean isVirtual = ArchiveHandlerManager.isVirtual(remoteParent);
|
|
||||||
boolean isArchive = ArchiveHandlerManager.getInstance().isArchive(localParent);
|
|
||||||
if (isVirtual || isArchive) {
|
if (isVirtual || isArchive) {
|
||||||
try {
|
try {
|
||||||
VirtualChild[] contents = null;
|
VirtualChild[] contents = null;
|
||||||
|
@ -761,28 +771,18 @@ public class LocalFileService extends AbstractFileService implements IFileServic
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isVirtualParent = false;
|
boolean isVirtualParent = false;
|
||||||
|
|
||||||
if (remoteParent != null) {
|
|
||||||
isVirtualParent = ArchiveHandlerManager.isVirtual(remoteParent);
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean isArchiveParent = false;
|
boolean isArchiveParent = false;
|
||||||
|
|
||||||
if (remoteParent != null) {
|
if (remoteParent != null) {
|
||||||
isArchiveParent = ArchiveHandlerManager.getInstance().isArchive(new File(remoteParent));
|
File remoteParentFile = new File(remoteParent);
|
||||||
|
if (!remoteParentFile.exists()) {
|
||||||
|
isVirtualParent = ArchiveHandlerManager.isVirtual(remoteParent);
|
||||||
|
} else if (remoteParentFile.isFile()) {
|
||||||
|
isArchiveParent = ArchiveHandlerManager.getInstance().isArchive(remoteParentFile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isVirtualParent && !isArchiveParent)
|
if (!isVirtualParent && !isArchiveParent)
|
||||||
{
|
{
|
||||||
File file = null;
|
File file = remoteParent==null ? new File(name) : new File(remoteParent, name);
|
||||||
if (remoteParent == null)
|
|
||||||
{
|
|
||||||
file = new File(name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
file = new File(remoteParent, name);
|
|
||||||
}
|
|
||||||
return new LocalHostFile(file);
|
return new LocalHostFile(file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue