gate.util.persistence
Class PersistenceManager.URLHolder

java.lang.Object
  extended by gate.util.persistence.PersistenceManager.URLHolder
All Implemented Interfaces:
Persistence, Serializable
Enclosing class:
PersistenceManager

public static class PersistenceManager.URLHolder
extends Object
implements Persistence

URLs get upset when serialised and deserialised so we need to convert them to strings for storage. In the case of "file:" URLs the relative path to the persistence file will actually be stored, except when the URL refers to a resource within the current GATE home directory in which case the relative path to the GATE home directory will be stored. If the property gate.user.resourceshom is set to a directory path and the URL refers to a resource inside this directory, the relative path to this directory will be stored. If resources are stored relative to gate home or resources home, a warning will also be logged.

See Also:
Serialized Form

Constructor Summary
PersistenceManager.URLHolder()
           
 
Method Summary
 Object createObject()
          Creates a new object from the data contained.
 void extractDataFromSource(Object source)
          Populates this Persistence with the data that needs to be stored from the original source object.
 File getCanonicalFileIfPossible(File file)
           
 File getGateHomePath()
           
 File getResourceshomePath()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceManager.URLHolder

public PersistenceManager.URLHolder()
Method Detail

extractDataFromSource

public void extractDataFromSource(Object source)
                           throws PersistenceException
Populates this Persistence with the data that needs to be stored from the original source object.

Specified by:
extractDataFromSource in interface Persistence
Throws:
PersistenceException

createObject

public Object createObject()
                    throws PersistenceException
Creates a new object from the data contained. This new object is supposed to be a copy for the original object used as source for data extraction.

Specified by:
createObject in interface Persistence
Throws:
PersistenceException

getGateHomePath

public File getGateHomePath()

getResourceshomePath

public File getResourceshomePath()

getCanonicalFileIfPossible

public File getCanonicalFileIfPossible(File file)