|
org.openide.modules 7.31 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openide.modules.Places
public abstract class Places
Provides access to standard file locations.
FileUtil.getConfigFile
to find a file declared in an XML layer or created or overridden in the config subdirectory of the user directory.
InstalledFileLocator to find modules installed as part of an NBM.
someClass.getProtectionDomain().getCodeSource().getLocation() to find resources inside a module class loader.
| Constructor Summary | |
|---|---|
protected |
Places()
Constructor for those who believe to know where getCacheDirectory() or
getUserDirectory() is. |
| Method Summary | |
|---|---|
protected abstract File |
findCacheDirectory()
The cache directory to return from getCacheDirectory(). |
protected abstract File |
findUserDirectory()
Finds location of a user directory to return from getUserDirectory(). |
static File |
getCacheDirectory()
Locates the NetBeans cache directory. |
static File |
getCacheSubdirectory(String path)
Convenience method to get a particular subdirectory within getCacheDirectory(). |
static File |
getCacheSubfile(String path)
Convenience method to get a particular file within getCacheDirectory(). |
static File |
getUserDirectory()
Locates the NetBeans user directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Places()
getCacheDirectory() or
getUserDirectory() is. Register your subclass via
ServiceProvider annotation.
| Method Detail |
|---|
public static File getUserDirectory()
FileUtil.getConfigFile) is inappropriate due its being virtual.
Each module is responsible for using sufficiently unique filenames within this directory.
The system property #USER_DIR_PROP is used for compatibility.
public static File getCacheDirectory()
$userdir/var/cache/ is used as a default when getUserDirectory() is configured.
As a final fallback, a location in the system temporary directory will be returned.
getCacheSubdirectory(java.lang.String),
getCacheSubfile(java.lang.String)public static File getCacheSubdirectory(String path)
getCacheDirectory().
The directory will be created if it does not yet exist (but a warning logged if permissions do not allow this).
path - a subdirectory path such as stuff or mymodule/stuff (/ permitted even on Windows)
public static File getCacheSubfile(String path)
getCacheDirectory().
The parent directory will be created if it does not yet exist (but a warning logged if permissions do not allow this);
the file itself will not be automatically created.
path - a file path such as stuff.ser or mymodule/stuff.ser (/ permitted even on Windows)
protected abstract File findCacheDirectory()
getCacheDirectory().
If null the caches will be placed below getUserDirectory().
protected abstract File findUserDirectory()
getUserDirectory().
null if no user directory is
supposed to be used
|
org.openide.modules 7.31 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||