public class ResourceManager
extends java.lang.Object
ResourceManager
class stores and retrieves
user-specific resources related to configuration settings,
palettes, overlays, and so on.Constructor and Description |
---|
ResourceManager() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
checkResources()
Checks any existing resources for recoverable problems.
|
static void |
copyStream(java.io.InputStream input,
java.io.OutputStream output,
boolean doClose)
Copies data from an input stream to an output stream.
|
static java.util.List |
getOpendapList()
Gets the list of OPeNDAP servers from the user-specified
resources.
|
static OverlayGroupManager |
getOverlayManager()
Gets an overlay group manager instance that reads overlays
from the user-specific resources.
|
static Preferences |
getPreferences()
Gets a preferences instance from the user-specific resources.
|
static void |
setOpendapList(java.util.List opendapList)
Sets the OPeNDAP server list using the specified list of
ServerTableModel.Entry objects. |
static void |
setPreferences(Preferences preferences)
Sets the preferences using the specified object.
|
static void |
setupOpendap()
Sets up the user-specified OPeNDAP servers.
|
static void |
setupOverlays()
Sets up the user-specified overlays.
|
static void |
setupPalettes()
Sets up the user-specified palettes.
|
static void |
setupPreferences()
Sets up the user-specified preferences.
|
public static void setupPalettes() throws java.io.IOException
java.io.IOException
- if an error occurred setting up the palettes.PaletteFactory.getPredefined()
public static void copyStream(java.io.InputStream input, java.io.OutputStream output, boolean doClose) throws java.io.IOException
input
- the input stream to read.output
- the output stream to write.doClose
- true to close input and output after copying.java.io.IOException
- if an error occurred reading or writing data.public static java.lang.String checkResources() throws java.io.IOException
java.io.IOException
- if an error occurred checking the resources.public static void setupOverlays() throws java.io.IOException
java.io.IOException
- if an error occurred setting up the overlays.public static OverlayGroupManager getOverlayManager()
public static void setupPreferences() throws java.io.IOException
java.io.IOException
- if an error occurred setting up the
preferences.public static void setupOpendap() throws java.io.IOException
java.io.IOException
- if an error occurred setting up the servers.public static java.util.List getOpendapList()
ServerTableModel.Entry
objects.java.lang.RuntimeException
- if an error occurred setting up the
initial list, or reading the list from disk.public static void setOpendapList(java.util.List opendapList)
ServerTableModel.Entry
objects.
Subsequent calls to getOpendapList()
will return the
new list. The list is also saved to the user-specified
resources.java.lang.RuntimeException
- if an error occurred writing the
list to disk.public static void setPreferences(Preferences preferences)
getPreferences()
will return the new
preferences. The preferences are also saved to the
user-specified resources.java.lang.RuntimeException
- if an error occurred writing the
preferences to disk.public static Preferences getPreferences()
java.lang.RuntimeException
- if an error occurred setting up the
initial preferences, or reading the preferences from disk.