public class GappModel extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GappModel.MavenPlugin
Very simple "struct" for a set of Maven co-ordinates.
|
Constructor and Description |
---|
GappModel(URL gappFileURL) |
GappModel(URL gappFileURL,
URL gateHomeURL) |
GappModel(URL gappFileURL,
URL gateHomeURL,
URL resourcesHomeURL)
Create a GappModel for a GAPP file.
|
Modifier and Type | Method and Description |
---|---|
void |
finish()
Finish up processing of the gapp file ready for writing.
|
org.jdom.Document |
getGappDocument()
Get the JDOM Document representing this GAPP file.
|
URL |
getGappFileURL()
Get the URL at which the GAPP file resides.
|
List<GappModel.MavenPlugin> |
getMavenPlugins()
Get the Maven plugins referenced by this GAPP file.
|
Set<URL> |
getPluginURLs()
Get the plugin URLs that are referenced by relative paths in this
GAPP file.
|
Set<URL> |
getResourceURLs()
Get the resource URLs that are referenced by relative paths in this
GAPP file.
|
void |
setGappFileURL(URL gappFileURL)
Set the URL at which the GAPP file resides.
|
void |
updatePathForURL(URL originalURL,
URL newURL,
boolean makeRelative)
Update the modelled content of the GAPP file to replace any
relative paths referring to
originalURL with those
pointing to newURL . |
void |
write()
Write out the (possibly modified) GAPP file to its new location.
|
public GappModel(URL gappFileURL)
GappModel(URL,URL, URL)
public GappModel(URL gappFileURL, URL gateHomeURL)
GappModel(URL,URL, URL)
public GappModel(URL gappFileURL, URL gateHomeURL, URL resourcesHomeURL)
gappFileURL
- the URL of the GAPP file to model.gateHomeURL
- the URL against which $gatehome$ relative paths should
be resolved. This may be null if you are sure that the GAPP you are
packaging does not contain any $gatehome$ paths. If no gateHomeURL is
provided but the application does contain a $gatehome$ path, a
GateRuntimeException will be thrown.resourcesHomeURL
- the URL against which $resourceshome$ relative paths should
be resolved. This may be null if you are sure that the GAPP you are
packaging does not contain any $resourceshome$ paths. If no gateHomeURL is
provided but the application does contain a $resourceshome$ path, a
GateRuntimeException will be thrown.public URL getGappFileURL()
public void setGappFileURL(URL gappFileURL)
gappFileURL
- the gappFileURL to setpublic org.jdom.Document getGappDocument()
public Set<URL> getPluginURLs()
public List<GappModel.MavenPlugin> getMavenPlugins()
public Set<URL> getResourceURLs()
public void updatePathForURL(URL originalURL, URL newURL, boolean makeRelative)
originalURL
with those
pointing to newURL
. If makeRelative is
true
, the new path will be relativized against the
current gappFileURL
, so you should call
setGappFileURL(java.net.URL)
with the URL at which the file will
ultimately be saved before calling this method. If
makeRelative
is false
the new URL
will be used directly as an absolute URL (so to replace a relative
path with the absolute URL to the same file you can call
updatePathForURL(u, u, false)
).originalURL
- The original URL whose references are to be
replaced.newURL
- the replacement URL.makeRelative
- should we relativize the newURL before use?public void finish()
public void write() throws IOException
IOException
- if an I/O error occurs.Copyright © 2024 GATE. All rights reserved.