public class PathUpdate extends Object
Constructor and Description |
---|
PathUpdate(URI oldLocation,
URI newLocation)
Create a path updater based on a pair of known old and new locations.
|
Modifier and Type | Method and Description |
---|---|
URI |
changePath(URI oldSource)
Create an alternative path for the given location if it matches changes
from old to new location.
|
URI |
findLocation(URI uri,
boolean tryFallback,
boolean allowResource)
Tries to find an existing readable URI.
if the URI isn't absolute: if a new location is available it is resolved against that if an old location is available it is resolved against that if the URI is absolute: if an old and a new location is available it is transformed in the same way the URI is used as is If none of the applicable cases results in a valid, existing URI and tryFallback is true updatePathFallback(URI) is returned,
otherwise null is returned. |
URI |
findLocation(URI uri,
boolean tryFallback,
boolean allowResource,
boolean keepRelative)
Tries to find an existing readable URI.
if the URI isn't absolute: if a new location is available it is resolved against that if an old location is available it is resolved against that if the URI is absolute: if an old and a new location is available it is transformed in the same way the URI is used as is If none of the applicable cases results in a valid, existing URI and tryFallback is true updatePathFallback(URI) is returned,
otherwise null is returned. |
URI |
getNewLocation() |
URI |
getOldLocation() |
protected URI |
updatePathFallback(URI oldLocation)
Update the path to a resource if automatic update fails.
|
public URI findLocation(URI uri, boolean tryFallback, boolean allowResource)
updatePathFallback(URI)
is returned,
otherwise null
is returned.uri
- the URI in questiontryFallback
- whether to use updatePathFallback(URI)
in the
end or notallowResource
- whether to allow resolving through Resources
null
public URI findLocation(URI uri, boolean tryFallback, boolean allowResource, boolean keepRelative)
updatePathFallback(URI)
is returned,
otherwise null
is returned.uri
- the URI in questiontryFallback
- whether to use updatePathFallback(URI)
in the
end or notallowResource
- whether to allow resolving through Resources
keepRelative
- If the URI is relative to the new location and
keepRelative is set, the URI is returned as is.null
public URI changePath(URI oldSource)
oldSource
- path where the file was saved topublic URI getOldLocation()
public URI getNewLocation()
protected URI updatePathFallback(URI oldLocation)
null
, which means the location is not
updated.oldLocation
- the old resource locationnull
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a