gov.nih.nci.cagrid.introduce.common
Class ResourceManager

java.lang.Object
  extended by gov.nih.nci.cagrid.introduce.common.ResourceManager

public class ResourceManager
extends java.lang.Object

Author:
Shannon Hastings , Scott Oster , Stephen Langella

Field Summary
static java.lang.String CACHE_POSTFIX
           
static java.lang.String CONFIG_PROPERTIES_FILE
           
static java.lang.String LAST_DEPLOYMENT
           
static java.lang.String LAST_DIRECTORY
           
static java.lang.String LAST_FILE
           
static int MAX_ARCHIVE
           
static java.lang.String SERVICE_URL_FILE
           
static java.lang.String STATE_FILE
           
 
Constructor Summary
ResourceManager()
           
 
Method Summary
static void createArchive(java.lang.String id, java.lang.String serviceName, java.lang.String baseDir)
           
static java.lang.String[] getBackups(java.lang.String serviceName)
           
static java.lang.String getConfigurationProperty(java.lang.String key)
           
static java.util.Enumeration getConfigurationPropertyKeys()
           
static java.io.File getIntroduceUserHome()
           
static java.lang.String getResourcePath()
           
static java.lang.String getServiceCachePath()
           
static java.lang.String getServiceURLProperty(java.lang.String key)
           
static java.util.Enumeration getServiceURLPropertyKeys()
           
static java.lang.String getStateProperty(java.lang.String key)
           
static void main(java.lang.String[] args)
           
static java.lang.String promptDir(java.awt.Component owner, java.lang.String defaultLocation)
           
static java.lang.String promptDir(java.lang.String defaultLocation)
           
static java.lang.String promptFile(java.awt.Component owner, java.lang.String defaultLocation, javax.swing.filechooser.FileFilter filter)
           
static java.lang.String promptFile(java.lang.String defaultLocation, javax.swing.filechooser.FileFilter filter)
           
static java.lang.String[] promptMultiFiles(java.awt.Component owner, java.lang.String defaultLocation, javax.swing.filechooser.FileFilter filter)
           
static java.lang.String[] promptMultiFiles(java.lang.String defaultLocation, javax.swing.filechooser.FileFilter filter)
           
static void purgeArchives(java.lang.String serviceName)
           
static void restoreLatest(java.lang.String currentId, java.lang.String serviceName, java.lang.String baseDir)
           
static void restoreSpecific(java.lang.String currentId, java.lang.String serviceName, java.lang.String baseDir)
           
static void setConfigurationProperty(java.lang.String key, java.lang.String value)
           
static void setServiceURLProperty(java.lang.String key, java.lang.String value)
           
static void setStateProperty(java.lang.String key, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ARCHIVE

public static final int MAX_ARCHIVE
See Also:
Constant Field Values

SERVICE_URL_FILE

public static final java.lang.String SERVICE_URL_FILE
See Also:
Constant Field Values

CONFIG_PROPERTIES_FILE

public static final java.lang.String CONFIG_PROPERTIES_FILE
See Also:
Constant Field Values

STATE_FILE

public static final java.lang.String STATE_FILE
See Also:
Constant Field Values

CACHE_POSTFIX

public static final java.lang.String CACHE_POSTFIX
See Also:
Constant Field Values

LAST_DIRECTORY

public static final java.lang.String LAST_DIRECTORY
See Also:
Constant Field Values

LAST_DEPLOYMENT

public static final java.lang.String LAST_DEPLOYMENT
See Also:
Constant Field Values

LAST_FILE

public static final java.lang.String LAST_FILE
See Also:
Constant Field Values
Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

getIntroduceUserHome

public static java.io.File getIntroduceUserHome()

getResourcePath

public static java.lang.String getResourcePath()

getServiceCachePath

public static java.lang.String getServiceCachePath()

getServiceURLProperty

public static java.lang.String getServiceURLProperty(java.lang.String key)

getServiceURLPropertyKeys

public static java.util.Enumeration getServiceURLPropertyKeys()

setServiceURLProperty

public static void setServiceURLProperty(java.lang.String key,
                                         java.lang.String value)
                                  throws java.io.IOException
Throws:
java.io.IOException

getConfigurationProperty

public static java.lang.String getConfigurationProperty(java.lang.String key)

getConfigurationPropertyKeys

public static java.util.Enumeration getConfigurationPropertyKeys()

setConfigurationProperty

public static void setConfigurationProperty(java.lang.String key,
                                            java.lang.String value)
                                     throws java.io.IOException
Throws:
java.io.IOException

getStateProperty

public static java.lang.String getStateProperty(java.lang.String key)
                                         throws java.io.IOException
Throws:
java.io.IOException

setStateProperty

public static void setStateProperty(java.lang.String key,
                                    java.lang.String value)
                             throws java.io.IOException
Throws:
java.io.IOException

purgeArchives

public static void purgeArchives(java.lang.String serviceName)

createArchive

public static void createArchive(java.lang.String id,
                                 java.lang.String serviceName,
                                 java.lang.String baseDir)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

restoreSpecific

public static void restoreSpecific(java.lang.String currentId,
                                   java.lang.String serviceName,
                                   java.lang.String baseDir)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

getBackups

public static java.lang.String[] getBackups(java.lang.String serviceName)

restoreLatest

public static void restoreLatest(java.lang.String currentId,
                                 java.lang.String serviceName,
                                 java.lang.String baseDir)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException,
                                 java.lang.Exception
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.Exception

promptDir

public static java.lang.String promptDir(java.lang.String defaultLocation)
                                  throws java.io.IOException
Throws:
java.io.IOException

promptDir

public static java.lang.String promptDir(java.awt.Component owner,
                                         java.lang.String defaultLocation)
                                  throws java.io.IOException
Throws:
java.io.IOException

promptFile

public static java.lang.String promptFile(java.lang.String defaultLocation,
                                          javax.swing.filechooser.FileFilter filter)
                                   throws java.io.IOException
Throws:
java.io.IOException

promptFile

public static java.lang.String promptFile(java.awt.Component owner,
                                          java.lang.String defaultLocation,
                                          javax.swing.filechooser.FileFilter filter)
                                   throws java.io.IOException
Throws:
java.io.IOException

promptMultiFiles

public static java.lang.String[] promptMultiFiles(java.lang.String defaultLocation,
                                                  javax.swing.filechooser.FileFilter filter)
                                           throws java.io.IOException
Throws:
java.io.IOException

promptMultiFiles

public static java.lang.String[] promptMultiFiles(java.awt.Component owner,
                                                  java.lang.String defaultLocation,
                                                  javax.swing.filechooser.FileFilter filter)
                                           throws java.io.IOException
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)