LibraryLoader.javaAPI DocExample1713Fri Feb 21 13:11:54 GMT 2003None


public class LibraryLoader extends Object

Fields Summary
static final String
static final String
Constructors Summary
Methods Summary
public LibraryLoader$ConfigDataload()

    // Find the config file and fetch its contents as Properties
    Resource config = new Resource(CONFIG_FILE);
    Properties props = new Properties();

    // Determine the source dir of the config file and look for a cache file
    // next to it containing a full representation of our program state.
    // If we find a cache file and it is current, load and return that data.
    if (config.getDirectory() != null) {
      File cache = new File(config.getDirectory(), CACHE_FILE);
      if (cache.exists() &&
            cache.lastModified() >= config.lastModified()) {
        try {
          return loadCache(new FileInputStream(cache));
        catch (IOException ignored) { }

    // We get here if there's no cache file or it's stale and we need to do a
    // full reload.  Locate the name of the raw data file from the config file
    // and return its contents using Resource.
    Resource data = new Resource(props.getProperty("data.file"));
    return loadData(data.getInputStream());
private LibraryLoader$ConfigDataloadCache( in)

    // Read the file, perhaps as a serialized object
    return null;
private LibraryLoader$ConfigDataloadData( in)

    // Read the file, perhaps as XML
    return null;