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 |
} |