From bf869e9058f3801e95eb25a3af3f3944d00931bb Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Thu, 10 Apr 2008 14:21:44 +0000 Subject: [PATCH] [187571] Classification is empty for local directories --- .../files/local/model/LocalFile.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.local/src/org/eclipse/rse/internal/subsystems/files/local/model/LocalFile.java b/rse/plugins/org.eclipse.rse.subsystems.files.local/src/org/eclipse/rse/internal/subsystems/files/local/model/LocalFile.java index 89840abfcea..16418e2ca06 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.local/src/org/eclipse/rse/internal/subsystems/files/local/model/LocalFile.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.local/src/org/eclipse/rse/internal/subsystems/files/local/model/LocalFile.java @@ -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 * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,12 +7,12 @@ * * Initial Contributors: * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. - * + * * 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; @@ -36,12 +36,12 @@ public class LocalFile extends AbstractRemoteFile implements IRemoteFile super(subSystem, context, parent, hostFile); _localHostFile = hostFile; } - + public Object getFile() { return _localHostFile.getFile(); } - + public boolean isVirtual() { return false; @@ -58,14 +58,18 @@ public class LocalFile extends AbstractRemoteFile implements IRemoteFile return ""; //$NON-NLS-1$ } } - + public String getClassification() { - - if (_classification == null && isFile()) - { - _classification = SystemFileClassifier.getInstance().classifyFile(getAbsolutePath()); + + if (_classification == null) { + if (isFile()) { + _classification = SystemFileClassifier.getInstance().classifyFile(getAbsolutePath()); + } else if (isDirectory()) { + _classification = "directory"; //$NON-NLS-1$ + } else { + _classification = "unknown"; //$NON-NLS-1$ + } } - return _classification; }