|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.plugin.war.util.WebappStructure
public class WebappStructure
Represents the structure of a web application composed of multiple overlays. Each overlay is registered within this structure with the set of files it holds.
Note that this structure is persisted to disk at each invocation to store which owner holds which path (file).
Nested Class Summary | |
---|---|
static interface |
WebappStructure.DependenciesAnalysisCallback
Callback interface to handle events related to dependencies analysis. |
static interface |
WebappStructure.RegistrationCallback
Callback interface to handle events related to filepath registration in the webapp. |
Constructor Summary | |
---|---|
WebappStructure(List dependencies)
Creates a new empty instance. |
|
WebappStructure(List dependencies,
WebappStructure cache)
Creates a new instance with the specified cache. |
Method Summary | |
---|---|
void |
analyseDependencies(WebappStructure.DependenciesAnalysisCallback callback)
Analyze the dependencies of the project using the specified callback. |
String |
getCachedTargetFileName(Dependency dependency)
Returns the cached target file name that matches the specified dependency, that is the target file name of the previous run. |
List |
getDependencies()
Returns the dependencies of the project. |
List |
getDependenciesInfo()
Returns the list of DependencyInfo for the project. |
PathSet |
getFullStructure()
Returns all paths that have been registered so far. |
String |
getOwner(String path)
Returns the owner of the specified path. |
Set |
getOwners()
Returns the owners. |
PathSet |
getStructure(String id)
Returns the list of registered files for the specified owner. |
boolean |
isRegistered(String path)
Specify if the specified path is registered or not. |
boolean |
registerFile(String id,
String path)
Registers the specified path for the specified owner. |
void |
registerFile(String id,
String path,
WebappStructure.RegistrationCallback callback)
Registers the specified path for the specified owner. |
boolean |
registerFileForced(String id,
String path)
Forces the registration of the specified path for the specified owner. |
void |
registerTargetFileName(Artifact artifact,
String targetFileName)
Registers the target file name for the specified artifact. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebappStructure(List dependencies)
dependencies
- the dependencies of the projectpublic WebappStructure(List dependencies, WebappStructure cache)
dependencies
- the dependencies of the projectcache
- the cacheMethod Detail |
---|
public List getDependenciesInfo()
DependencyInfo
for the project.
public List getDependencies()
public boolean isRegistered(String path)
path
- the relative path from the webapp root directory
public boolean registerFile(String id, String path)
id
- the owner of the pathpath
- the relative path from the webapp root directory
public boolean registerFileForced(String id, String path)
registerFile(String, String)
; returns true if an
owner replacement was made and false if the file was simply registered
for the first time.
id
- the owner of the pathpath
- the relative path from the webapp root directory
public void registerFile(String id, String path, WebappStructure.RegistrationCallback callback) throws IOException
id
- the owner of the pathpath
- the relative path from the webapp root directorycallback
- the callback to invoke with the result of the registration
IOException
- if the callback invocation throws an IOExceptionpublic String getOwner(String path)
path
- the relative path from the webapp root directory
public Set getOwners()
Set
may be
inconsistent since it represents a persistent cache across multiple
invocations.
For instance, if an overlay was removed in this execution, it will be
still be there till the cache is cleaned. This happens when the clean
mojo is invoked.
public PathSet getFullStructure()
public PathSet getStructure(String id)
id
- the owner
public void analyseDependencies(WebappStructure.DependenciesAnalysisCallback callback)
callback
- the callback to use to report the result of the analysispublic void registerTargetFileName(Artifact artifact, String targetFileName)
artifact
- the artifacttargetFileName
- the target file namepublic String getCachedTargetFileName(Dependency dependency)
dependency
- a dependency
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |