public abstract class AbstractFileResourceFacet extends AbstractBaseFacet
relFilePath
and implement the
method getResourceContent
.MAIN_PROFILE
Constructor and Description |
---|
AbstractFileResourceFacet() |
Modifier and Type | Method and Description |
---|---|
File |
getAbsoluteFilePath() |
abstract String |
getRelFilePath()
The path (relative to the project root directory) of the file resource to
be installed.
|
protected abstract String |
getResourceContent()
Get a String to be written to the resource file being installed by this
class.
|
boolean |
install() |
boolean |
isInstalled() |
protected StringBuilder |
readResource(String resource)
Reads a classpath resource into a
StringBuilder . |
protected void |
replace(StringBuilder subject,
String toReplace,
String replacement)
Replace all occurrences of a
String in a give StringBuilder
. |
boolean |
uninstall() |
addDependenciesToProfile, error, getDependency, getDependency, getProject, hasDependency, hasProvidedDependency, warning
equals, getFaceted, hashCode, setFaceted
public abstract String getRelFilePath()
public boolean install()
protected abstract String getResourceContent() throws Exception
relFilePath
.Exception
protected StringBuilder readResource(String resource) throws IOException
StringBuilder
.resource
- The name of the classpath resource to be copied.StringBuilder
containing the contents of the specified
resource.IOException
protected void replace(StringBuilder subject, String toReplace, String replacement)
String
in a give StringBuilder
.subject
- The StringBuilder
to be modified.toReplace
- The String
to be replaced.replacement
- The replacement String
.public boolean isInstalled()
public File getAbsoluteFilePath()
public boolean uninstall()
uninstall
in interface org.jboss.forge.addon.facets.Facet<org.jboss.forge.addon.projects.Project>
uninstall
in class org.jboss.forge.addon.facets.AbstractFacet<org.jboss.forge.addon.projects.Project>
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.