This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 37549
Collapse All | Expand All

(-)openide/src/org/openide/filesystems/FileUtil.java (+26 lines)
Lines 18-23 Link Here
18
import java.net.URLStreamHandler;
18
import java.net.URLStreamHandler;
19
import java.util.*;
19
import java.util.*;
20
import java.util.jar.*;
20
import java.util.jar.*;
21
import org.openide.util.NbBundle;
21
22
22
import org.openide.util.Utilities;
23
import org.openide.util.Utilities;
23
24
Lines 762-765 Link Here
762
    public static FileStatusListener weakFileStatusListener (FileStatusListener l, Object source) {
763
    public static FileStatusListener weakFileStatusListener (FileStatusListener l, Object source) {
763
        return (FileStatusListener)org.openide.util.WeakListeners.create (FileStatusListener.class, l, source);
764
        return (FileStatusListener)org.openide.util.WeakListeners.create (FileStatusListener.class, l, source);
764
    }
765
    }
766
    
767
    /**
768
     * Get an appropriate display name for a file object.
769
     * If the file corresponds to a path on disk, this will be the disk path.
770
     * Otherwise the name will mention the filesystem and relative path.
771
     * @param fo a file object
772
     * @return a display name indicating where the file is
773
     * @since XXX
774
     */
775
    public static String getFileDisplayName(FileObject fo) {
776
        File f = toFile(fo);
777
        if (f != null) {
778
            return f.getAbsolutePath();
779
        } else {
780
            try {
781
                FileSystem fs = fo.getFileSystem();
782
                return NbBundle.getMessage(FileUtil.class, "LBL_file_in_filesystem",
783
                                           fo.getPath(), fs.getDisplayName());
784
            } catch (FileStateInvalidException e) {
785
                // Not relevant now, just use the simple path.
786
                return fo.getPath();
787
            }
788
        }
789
    }
790
    
765
}
791
}
(-)openide/src/org/openide/filesystems/Bundle.properties (-1 / +6 lines)
Lines 6-12 Link Here
6
# http://www.sun.com/
6
# http://www.sun.com/
7
# 
7
# 
8
# The Original Code is NetBeans. The Initial Developer of the Original
8
# The Original Code is NetBeans. The Initial Developer of the Original
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
10
# Microsystems, Inc. All Rights Reserved.
10
# Microsystems, Inc. All Rights Reserved.
11
11
12
# Repository
12
# Repository
Lines 152-154 Link Here
152
XML_InaccurateParam=Inaccurate number of parameters
152
XML_InaccurateParam=Inaccurate number of parameters
153
XML_UnknownElement=Unknown element.
153
XML_UnknownElement=Unknown element.
154
XML_DuplElement=Duplicated FileObject:
154
XML_DuplElement=Duplicated FileObject:
155
156
# FileUtil
157
# {0} - relative file path
158
# {1} - filesystem display name
159
LBL_file_in_filesystem={0} in {1}

Return to bug 37549