org.netbeans.core.startup/1 1.40

org.netbeans.core.startup
Class InstalledFileLocatorImpl

java.lang.Object
  extended by org.openide.modules.InstalledFileLocator
      extended by 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}.


Constructor Summary
InstalledFileLocatorImpl()
           
 
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 org.openide.modules.InstalledFileLocator
getDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstalledFileLocatorImpl

public InstalledFileLocatorImpl()
Method Detail

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

org.netbeans.core.startup/1 1.40

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.