|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.plugin.AbstractMojo org.apache.sling.maven.bundlesupport.BundleUninstallMojo
public class BundleUninstallMojo
Uninstall an OSGi bundle from a running Sling instance.
Field Summary | |
---|---|
protected java.lang.String |
mimeType
The content type / mime type used for the HTTP PUT (if sling.usePut=true ). |
protected org.apache.maven.project.MavenProject |
project
The Maven project. |
protected java.lang.String |
slingUrl
The URL of the running Sling instance. |
protected java.lang.String |
slingUrlSuffix
An optional url suffix which will be appended to the sling.url
for use as the real target url. |
protected boolean |
usePut
If a simple HTTP PUT should be used instead of the standard POST to the felix console. |
Fields inherited from interface org.apache.maven.plugin.Mojo |
---|
ROLE |
Constructor Summary | |
---|---|
BundleUninstallMojo()
|
Method Summary | |
---|---|
protected void |
addConfiguration(org.apache.commons.httpclient.HttpClient client,
java.lang.String targetURL,
java.lang.String dir,
java.lang.String path)
Add a new configuration for the file system provider |
protected java.lang.String |
checkWebConsoleVersion(java.lang.String targetUrl)
Try to get the version of the web console |
protected void |
configure(java.lang.String targetURL,
java.io.File file)
Add configurations to a running OSGi instance for initial content. |
protected void |
delete(java.lang.String targetURL,
java.io.File file)
|
void |
execute()
|
protected java.lang.String |
getBundleFileName()
|
protected java.lang.String |
getBundleSymbolicName(java.io.File jarFile)
Returns the symbolic name of the given bundle. |
protected java.util.Map |
getCurrentFileProviderConfigs(java.lang.String targetURL,
org.apache.commons.httpclient.HttpClient client)
Return all file provider configs for this project |
protected org.apache.commons.httpclient.HttpClient |
getHttpClient()
Get the http client |
protected java.util.jar.Manifest |
getManifest(java.io.File bundleFile)
Get the manifest from the File. |
protected java.lang.String |
getPutURL(java.lang.String targetURL,
java.lang.String fileName)
Returns the URL for PUT or DELETE by appending the filename to the targetURL. |
protected java.lang.String |
getTargetURL()
Returns the combination of sling.url and
sling.urlSuffix . |
protected void |
post(java.lang.String targetURL,
java.io.File file)
|
protected void |
post(java.lang.String targetURL,
java.lang.String symbolicName)
|
protected void |
put(java.lang.String targetURL,
java.io.File file)
|
protected void |
removeConfiguration(org.apache.commons.httpclient.HttpClient client,
java.lang.String targetURL,
java.lang.String pid)
|
protected void |
throwWebConsoleTooOldException()
Helper method to throw a meaningful exception for an outdated felix web console. |
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
---|
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String slingUrl
protected java.lang.String slingUrlSuffix
sling.url
for use as the real target url. This allows to configure different target URLs
in each POM, while using the same common sling.url
in a parent
POM (eg. sling.url=http://localhost:8080
and
sling.urlSuffix=/project/specific/path
). This is typically used
in conjunction with a HTTP PUT (sling.usePut=true
).
protected boolean usePut
uninstall
goal, a HTTP DELETE will be
used.
protected java.lang.String mimeType
sling.usePut=true
).
protected org.apache.maven.project.MavenProject project
Constructor Detail |
---|
public BundleUninstallMojo()
Method Detail |
---|
protected java.lang.String getBundleFileName()
public void execute() throws org.apache.maven.plugin.MojoExecutionException
execute
in interface org.apache.maven.plugin.Mojo
org.apache.maven.plugin.MojoExecutionException
Mojo.execute()
protected void delete(java.lang.String targetURL, java.io.File file) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected void post(java.lang.String targetURL, java.lang.String symbolicName) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected void configure(java.lang.String targetURL, java.io.File file) throws org.apache.maven.plugin.MojoExecutionException
targetURL
- The web console base urlfile
- The artifact (bundle)
org.apache.maven.plugin.MojoExecutionException
protected java.lang.String getTargetURL()
sling.url
and
sling.urlSuffix
.
protected java.lang.String getPutURL(java.lang.String targetURL, java.lang.String fileName)
protected void throwWebConsoleTooOldException() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected org.apache.commons.httpclient.HttpClient getHttpClient()
protected void post(java.lang.String targetURL, java.io.File file) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected void put(java.lang.String targetURL, java.io.File file) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected void removeConfiguration(org.apache.commons.httpclient.HttpClient client, java.lang.String targetURL, java.lang.String pid) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected void addConfiguration(org.apache.commons.httpclient.HttpClient client, java.lang.String targetURL, java.lang.String dir, java.lang.String path) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected java.util.Map getCurrentFileProviderConfigs(java.lang.String targetURL, org.apache.commons.httpclient.HttpClient client) throws org.apache.maven.plugin.MojoExecutionException
targetURL
- The targetURL of the webconsoleclient
- The http client
org.apache.maven.plugin.MojoExecutionException
protected java.util.jar.Manifest getManifest(java.io.File bundleFile) throws java.io.IOException
bundleFile
- The bundle jar
java.io.IOException
protected java.lang.String checkWebConsoleVersion(java.lang.String targetUrl)
null
if version is not detectable.protected java.lang.String getBundleSymbolicName(java.io.File jarFile)
jarFile
does not contain a manifest with a
Bundle-SymbolicName
header null
is
returned. Otherwise the value of the Bundle-SymbolicName
header is returned.
This method may also be used to check whether the file is a bundle at all
as it is assumed, that only if the file contains an OSGi bundle will the
Bundle-SymbolicName
manifest header be set.
jarFile
- The file providing the bundle whose symbolic name is
requested.
Bundle-SymbolicName
manifest header or
null
if no manifest exists in the file or the
header is not contained in the manifest. However, if
null
is returned, the file may be assumed to not
contain an OSGi bundle.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |