public static class PersistenceManager.URLHolder extends Object implements Persistence
PersistenceManager.saveObjectToFile(Object,File,boolean,boolean)
was
used and there is one of the following cases:
The real path as returned by getCanonicalPath() is used to check if the resource is within a special directory (e.g. GATE HOME). Once we know this, and the resource is in a special directory, the canonical paths are used to generate the relative path. If we are not inside a special directory, then the non-canonical path names will be used, so that any symbolic links are NOT getting resolved, which is usually what you want. The non-canonical path names will get normalized to remove things like "../dir" and the result of the normalization is checked using getCanonicalPath() to see if it refers to the same location as the non-normalized one (it could be different if the .. follows a symbolic link, for example). If it is the same, then the normalized version is used, otherwise the original version is used.
Constructor and Description |
---|
URLHolder() |
Modifier and Type | Method and Description |
---|---|
static URI |
combineContextAndRelative(URI context,
String relative,
boolean contextIsFile) |
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.
|
static String |
getRelativeUri(URI context,
URI target) |
static String |
relativize(File outFile,
File urlFile) |
static URI |
unpackPersistentRepresentation(URI context,
String persistent) |
public static String relativize(File outFile, File urlFile) throws URISyntaxException
URISyntaxException
public void extractDataFromSource(Object source) throws PersistenceException
Persistence
extractDataFromSource
in interface Persistence
PersistenceException
public Object createObject() throws PersistenceException
createObject
in interface Persistence
PersistenceException
public static URI unpackPersistentRepresentation(URI context, String persistent) throws PersistenceException
PersistenceException
public static URI combineContextAndRelative(URI context, String relative, boolean contextIsFile)
Copyright © 2024 GATE. All rights reserved.