public class WebappStructure extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
WebappStructure.RegistrationCallback
Callback interface to handle events related to filepath registration in the webapp.
|
| Constructor and Description |
|---|
WebappStructure(List<org.apache.maven.model.Dependency> dependencies)
Creates a new empty instance.
|
| Modifier and Type | Method and Description |
|---|---|
List<org.apache.maven.model.Dependency> |
getDependencies()
Returns the dependencies of the project.
|
List<DependencyInfo> |
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<String> |
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(org.apache.maven.artifact.Artifact artifact,
String targetFileName)
Registers the target file name for the specified artifact.
|
public WebappStructure(List<org.apache.maven.model.Dependency> dependencies)
dependencies - the dependencies of the projectpublic List<DependencyInfo> getDependenciesInfo()
DependencyInfo for the project.public List<org.apache.maven.model.Dependency> getDependencies()
public boolean isRegistered(String path)
path is registered or not.path - the relative path from the webapp root directorypublic boolean registerFile(String id, String path)
true if the path is not already
registered, false otherwise.id - the owner of the pathpath - the relative path from the webapp root directorypublic boolean registerFileForced(String id, String path)
Beware that the semantic of the return boolean is different than the one from
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 directorypublic void registerFile(String id, String path, WebappStructure.RegistrationCallback callback) throws IOException
callback with the result of the
registration.id - the owner of the pathpath - the relative path from the webapp root directorycallback - the callback to invoke with the result of the registrationIOException - if the callback invocation throws an IOExceptionpublic String getOwner(String path)
path. If the file is not registered, returns nullpath - the relative path from the webapp root directorynull.public PathSet getFullStructure()
public PathSet getStructure(String id)
id - the ownerpublic void registerTargetFileName(org.apache.maven.artifact.Artifact artifact,
String targetFileName)
artifact - the artifacttargetFileName - the target file nameCopyright © 2002–2023 The Apache Software Foundation. All rights reserved.