|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.filesystems.URLMapper
Mapper from FileObject -> URL.
Should be registered in default lookup. For details see Lookup.getDefault()
.
For all methods, if the passed-in file object is the root folder
of some filesystem, then it is assumed that any valid file object
in that filesystem may also have a URL constructed for it by means
of appending the file object's resource path to the URL of the root
folder. If this cannot work for all file objects on the filesystem,
the root folder must not be assigned a URL of that type. nbfs: URLs
of course always work correctly in this regard.
Field Summary | |
static int |
EXTERNAL
URL which works inside this machine. |
static int |
INTERNAL
URL which works inside this VM. |
static int |
NETWORK
URL which works from networked machines. |
Constructor Summary | |
URLMapper()
|
Method Summary | |
static FileObject |
findFileObject(URL url)
Find an appropiate instance of FileObject that addresses this url |
static FileObject[] |
findFileObjects(URL url)
Deprecated. Use findFileObject(java.net.URL) instead. |
static URL |
findURL(FileObject fo,
int type)
Find a good URL for this file object which works according to type: -inside this VM - inside this machine - from networked machines |
abstract FileObject[] |
getFileObjects(URL url)
Get an array of FileObjects for this url. |
abstract URL |
getURL(FileObject fo,
int type)
Get a good URL for this file object which works according to type: -inside this VM - inside this machine - from networked machines The implementation can't use neither FileUtil.toFile(org.openide.filesystems.FileObject) nor FileUtil.toFileObject(java.io.File)
otherwise StackOverflowError maybe thrown. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int INTERNAL
public static final int EXTERNAL
file
for disk files (see File.toURI()
);
jar
to wrap other URLs (e.g. jar:file:/some/thing.jar!/some/entry).
public static final int NETWORK
Constructor Detail |
public URLMapper()
Method Detail |
public static URL findURL(FileObject fo, int type)
public abstract URL getURL(FileObject fo, int type)
FileUtil.toFile(org.openide.filesystems.FileObject)
nor FileUtil.toFileObject(java.io.File)
otherwise StackOverflowError maybe thrown.
public static FileObject[] findFileObjects(URL url)
findFileObject(java.net.URL)
instead.
findURL(FileObject fo, int type)
.
url
- to wanted FileObjects
public static FileObject findFileObject(URL url)
url
- url to be converted to file object
public abstract FileObject[] getFileObjects(URL url)
findFileObject
uses just first element (next elements won't be accepted anyway).
The implementation can't use neither FileUtil.toFile(org.openide.filesystems.FileObject)
nor FileUtil.toFileObject(java.io.File)
otherwise StackOverflowError maybe thrown.
There isn't necessary to return array here. The only one reason is just backward compatibility.
url
- to wanted FileObjects
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |