1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-24 00:33:48 +02:00

[187571] Classification is empty for local directories

This commit is contained in:
Martin Oberhuber 2008-04-10 14:21:44 +00:00
parent ad6d96c018
commit bf869e9058

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,12 +7,12 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [187571] Classification is empty for local directories
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.subsystems.files.local.model; package org.eclipse.rse.internal.subsystems.files.local.model;
@ -36,12 +36,12 @@ public class LocalFile extends AbstractRemoteFile implements IRemoteFile
super(subSystem, context, parent, hostFile); super(subSystem, context, parent, hostFile);
_localHostFile = hostFile; _localHostFile = hostFile;
} }
public Object getFile() public Object getFile()
{ {
return _localHostFile.getFile(); return _localHostFile.getFile();
} }
public boolean isVirtual() public boolean isVirtual()
{ {
return false; return false;
@ -58,14 +58,18 @@ public class LocalFile extends AbstractRemoteFile implements IRemoteFile
return ""; //$NON-NLS-1$ return ""; //$NON-NLS-1$
} }
} }
public String getClassification() { public String getClassification() {
if (_classification == null && isFile()) if (_classification == null) {
{ if (isFile()) {
_classification = SystemFileClassifier.getInstance().classifyFile(getAbsolutePath()); _classification = SystemFileClassifier.getInstance().classifyFile(getAbsolutePath());
} else if (isDirectory()) {
_classification = "directory"; //$NON-NLS-1$
} else {
_classification = "unknown"; //$NON-NLS-1$
}
} }
return _classification; return _classification;
} }