org.netbeans.core.startup
Class InstalledFileLocatorImpl
java.lang.Object
org.openide.modules.InstalledFileLocator
org.netbeans.core.startup.InstalledFileLocatorImpl
public final class InstalledFileLocatorImpl
- extends InstalledFileLocator
Ability to locate NBM-installed files.
Looks in ${netbeans.user} then each component of ${netbeans.dirs}
and finally ${netbeans.home}.
|
Method Summary |
static void |
discardCache()
Called after startup is essentially complete. |
File |
locate(String relativePath,
String codeNameBase,
boolean localized)
Searches user dir and install dir(s). |
Set<File> |
locateAll(String relativePath,
String codeNameBase,
boolean localized)
|
static void |
prepareCache()
Called from Main.run early in the startup sequence to indicate
that available files should be cached from now on. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InstalledFileLocatorImpl
public InstalledFileLocatorImpl()
prepareCache
public static void prepareCache()
- Called from
Main.run early in the startup sequence to indicate
that available files should be cached from now on. Should be matched by a call to
discardCache() since the cache will be invalid if the user
e.g. installs a new NBM without restarting.
discardCache
public static void discardCache()
- Called after startup is essentially complete.
After this point, the list of files in the installation are not
cached, since they might change due to dynamic NBM installation.
Anyway the heaviest uses of
InstalledFileLocator are
during startup so that is when the cache has the most effect.
XXX called somewhat too late, before all libraries are initialized.
Better might be to wait until a few seconds have passed since the last call.
Or check for changes in .lastModified files since these should change if
any NBM activity happens.
locate
public File locate(String relativePath,
String codeNameBase,
boolean localized)
- Searches user dir and install dir(s).
- Specified by:
locate in class InstalledFileLocator
locateAll
public Set<File> locateAll(String relativePath,
String codeNameBase,
boolean localized)
- Overrides:
locateAll in class InstalledFileLocator