Class IdvObjectStore

java.lang.Object
ucar.unidata.xml.XmlObjectStore
ucar.unidata.idv.IdvObjectStore
All Implemented Interfaces:
IdvConstants, PersistentStore

public class IdvObjectStore extends XmlObjectStore implements IdvConstants
Provides some IDV specific extensions to the XmlObjectStore. Creates the users local .unidata/idv directory, jython cache dir, etc.
Author:
IDV development team
  • Field Details

  • Constructor Details

    • IdvObjectStore

      public IdvObjectStore(IntegratedDataViewer idv, String systemName, String appName, XmlEncoder encoder, String overrideUserDirectory)
      Create the store.
      Parameters:
      idv - The IntegratedDataViewer for this object store
      systemName - The name of the top level directory (e.g., .unidata/idv)
      appName - The name of the subdir (e.g., DefaultIdv)
      encoder - The encoder to use for writing out and reading in the store
      overrideUserDirectory - If non-null this overrides wehre we look for the user's home directory. Else we use the user.home system property.
  • Method Details

    • getMadeUserDirectory

      public boolean getMadeUserDirectory()
      Get the MadeUserDirectory property. Was the user's directory created now.
      Returns:
      The MadeUserDirectory
    • getSystemDirectory

      public String getSystemDirectory()
      Get the path to the system directory. Ex: ~/.unidata/idv
      Returns:
      The system directory path.
    • processTable

      protected Hashtable processTable(Hashtable newTable)
      Overrwrite base class method to tweak any old property names
      Overrides:
      processTable in class XmlObjectStore
      Parameters:
      newTable - The table to process
      Returns:
      The tweaked table
    • getJythonCacheDir

      public String getJythonCacheDir()
      Create, if needed, and return the directory to use for the jython cache.
      Returns:
      The jython cache directory
    • getUserDirectory

      public File getUserDirectory()
      Get the users local directory. Example: ~/.unidata/idv/DefaultIdv
      Overrides:
      getUserDirectory in class XmlObjectStore
      Returns:
      The user's local IDV directory
    • setOverrideDirectory

      public void setOverrideDirectory(File newDirectory)
      Set the override directory.
      Parameters:
      newDirectory - dir to use
    • getDisplayTemplateDir

      public String getDisplayTemplateDir()
      Return the full path to the directory where we save the display control templates
      Returns:
      Template directory
    • getDataSourcesDir

      public String getDataSourcesDir()
      Return the full path to the directory where we save the display control templates
      Returns:
      Template directory
    • getPluginsDir

      public String getPluginsDir()
      Return the full path to the directory where we look for plugins
      Returns:
      Plugins directory
    • getLocalBundlesDir

      public String getLocalBundlesDir()
      Return the full path to the directory where we save the user's local bundles
      Returns:
      Bundle directory
    • getSavedBundlesDir

      public File getSavedBundlesDir()
      Return the full path to the directory where we save the user's local bundles
      Returns:
      Bundle directory
    • get

      public Object get(String key)
      Return the obejct held in the table identified by the given key. Override the base class method. If the property is not in the main.xml then check the idv properties
      Overrides:
      get in class XmlObjectStore
      Parameters:
      key - The object's key.
      Returns:
      The Object identified by the given key or null if not found.