mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 13:05:22 +02:00
[251729][dstore] problems querying symbolic link folder
This commit is contained in:
parent
a39604971e
commit
532a076d3f
3 changed files with 51 additions and 32 deletions
|
@ -38,6 +38,7 @@
|
|||
* David McKnight (IBM) - [244277] [dstore] NPE on file save from old client
|
||||
* David McKnight (IBM) - [246234] Change of file permissions changes the file owner
|
||||
* David McKnight (IBM) - [250168] handleCommand should not blindly set the status to "done"
|
||||
* David McKnight (IBM) - [251729][dstore] problems querying symbolic link folder
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.dstore.universal.miners;
|
||||
|
@ -897,6 +898,7 @@ public class UniversalFileSystemMiner extends Miner {
|
|||
*/
|
||||
public DataElement handleQueryGetRemoteObject(DataElement subject,
|
||||
DataElement status, String queryType) throws SystemMessageException {
|
||||
|
||||
File fileobj = null;
|
||||
boolean isVirtual = false;
|
||||
boolean isFilter = false;
|
||||
|
@ -915,11 +917,20 @@ public class UniversalFileSystemMiner extends Miner {
|
|||
else {
|
||||
filterValue = System.getProperty("user.home"); //$NON-NLS-1$
|
||||
}
|
||||
try {
|
||||
// "." needs canonical file
|
||||
fileobj = new File(filterValue).getCanonicalFile();
|
||||
}
|
||||
catch (Exception e){
|
||||
fileobj = new File(filterValue);
|
||||
}
|
||||
|
||||
subject.setAttribute(DE.A_VALUE, filterValue);
|
||||
}
|
||||
if (!isVirtual)
|
||||
else if (!isVirtual){
|
||||
fileobj = new File(filterValue);
|
||||
}
|
||||
}
|
||||
else if (queryType.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR))
|
||||
{
|
||||
String name = subject.getName();
|
||||
|
@ -951,6 +962,12 @@ public class UniversalFileSystemMiner extends Miner {
|
|||
|
||||
if (!isVirtual && fileobj != null && fileobj.exists()) {
|
||||
|
||||
String oldProperties = subject.getAttribute(DE.A_SOURCE);
|
||||
boolean isSymlink = oldProperties != null && (oldProperties.indexOf("symbolic link") > 0);//$NON-NLS-1$
|
||||
fullName = fileobj.getAbsolutePath();
|
||||
|
||||
/* should not need canonical path here. It causes bug 251729
|
||||
{
|
||||
// Get the canonical path name so that we preserve case for Windows
|
||||
// systems.
|
||||
// Even though Windows is case insensitive, we still want to
|
||||
|
@ -958,10 +975,11 @@ public class UniversalFileSystemMiner extends Miner {
|
|||
// when we show the path as a property to the user
|
||||
try {
|
||||
fullName = fileobj.getCanonicalPath();
|
||||
|
||||
} catch (IOException e) {
|
||||
return statusDone(status);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (fileobj.isFile())
|
||||
{
|
||||
|
@ -996,22 +1014,20 @@ public class UniversalFileSystemMiner extends Miner {
|
|||
subject.setAttribute(DE.A_NAME, name);
|
||||
subject.setAttribute(DE.A_VALUE, path);
|
||||
|
||||
String properties = setProperties(fileobj);
|
||||
|
||||
|
||||
// DKM - do basic property stuff here
|
||||
subject.setAttribute(DE.A_SOURCE, setProperties(fileobj));
|
||||
|
||||
|
||||
/*
|
||||
// if this is a symbolic link or a file, reclassify
|
||||
if (fileobj.isFile() || isSymlink){ //$NON-NLS-1$
|
||||
// classify the file too
|
||||
if (fileobj.isFile()) {
|
||||
subject.setAttribute(DE.A_SOURCE, subject
|
||||
.getAttribute(DE.A_SOURCE)
|
||||
+ "|" + FileClassifier.classifyFile(fileobj));
|
||||
FileClassifier classifier = new FileClassifier(subject);
|
||||
subject.setAttribute(DE.A_SOURCE, properties + "|" + classifier.classifyFile(fileobj)); //$NON-NLS-1$
|
||||
}
|
||||
else {
|
||||
subject.setAttribute(DE.A_SOURCE, properties + "|" + "directory"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
}
|
||||
*/
|
||||
|
||||
status.setAttribute(DE.A_SOURCE, IServiceConstants.SUCCESS);
|
||||
|
||||
} else if (isVirtual) {
|
||||
try {
|
||||
String goodFullPath = ArchiveHandlerManager
|
||||
|
@ -1114,7 +1130,7 @@ public class UniversalFileSystemMiner extends Miner {
|
|||
return null;
|
||||
|
||||
|
||||
return (str[10]);
|
||||
return (str[11]);
|
||||
}
|
||||
/**
|
||||
* Method to obtain the filter string of file or folder.
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Xuan Chen (IBM) - [191280] [dstore] Expand fails for folder "/folk" with 3361 children
|
||||
* Xuan Chen (IBM) - [215863]] NPE when Expanding Empty Zip File
|
||||
* Martin Oberhuber (Wind River) - [199854][api] Improve error reporting for archive handlers
|
||||
* David McKnight (IBM) - [251729][dstore] problems querying symbolic link folder
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
||||
|
@ -540,7 +541,7 @@ public class FileClassifier extends Thread
|
|||
|
||||
try
|
||||
{
|
||||
String referencedFile = aFile.getCanonicalPath();
|
||||
String referencedFile = aFile.getAbsolutePath();
|
||||
|
||||
// DKM - not sure why this was commented out but keeping it that way for now
|
||||
String specialEncoding = null;//System.getProperty("dstore.stdin.encoding");
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* David McKnight (IBM) - [209387] Should not delete elements for files that still exist (but are filtered out)
|
||||
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
|
||||
* David McKnight (IBM) - [251650] [dstore] Multiple copies of symbolic link file show in Table view
|
||||
* David McKnight (IBM) - [251729][dstore] problems querying symbolic link folder
|
||||
*******************************************************************************/
|
||||
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
||||
|
||||
|
@ -116,9 +117,11 @@ public class FileQueryThread extends QueryThread
|
|||
if (list != null)
|
||||
{
|
||||
createDataElement(_dataStore, _subject, list, _queryType, _filter,_inclusion);
|
||||
|
||||
if (_subject.getSource() == null || _subject.getSource().equals("")){ //$NON-NLS-1$
|
||||
String folderProperties = setProperties(_fileobj);
|
||||
if (_subject.getSource() == null || _subject.getSource().equals("")) //$NON-NLS-1$
|
||||
_subject.setAttribute(DE.A_SOURCE, folderProperties);
|
||||
}
|
||||
|
||||
if (!_isCancelled)
|
||||
{
|
||||
|
@ -151,7 +154,6 @@ public class FileQueryThread extends QueryThread
|
|||
protected void createDataElement(DataStore ds, DataElement subject,
|
||||
File[] list, String queryType, String filter, int include, String types[])
|
||||
{
|
||||
|
||||
HashMap filteredChildren = new HashMap();
|
||||
List children = subject.getNestedData();
|
||||
if (children != null)
|
||||
|
|
Loading…
Add table
Reference in a new issue