Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.ide.extension.spi
Class JARExtensionSource  view JARExtensionSource download JARExtensionSource.java

java.lang.Object
  extended byjavax.ide.extension.spi.JARExtensionSource
All Implemented Interfaces:
ExtensionSource

public class JARExtensionSource
extends java.lang.Object
implements ExtensionSource

A default implementation of ExtensionSource which loads an extension manifest from the META-INF/extension.xml entry of a JAR file.


Field Summary
private  java.net.URI _jarURI
           
private  java.net.URI _manifestURI
           
private static java.lang.String MANIFEST_ALT_ENTRY
           
private static java.lang.String MANIFEST_ENTRY
           
 
Constructor Summary
JARExtensionSource(java.net.URI jarURI)
           
 
Method Summary
 java.net.URI getClasspathEntry()
          Get the classpath entry for this extension source.
 java.io.InputStream getInputStream()
          Get an input stream for this sources manifest.
 java.net.URI getManifestURI()
          Get the URI of the manifest file within the extension source.
 java.lang.String getName()
          Get the name of this source.
 java.net.URI getURI()
          Get the URI of this JAR file.
 java.net.URI resolvePath(javax.ide.extension.Extension extension, java.lang.String path)
          Resolve a relative path from the manifest file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MANIFEST_ENTRY

private static final java.lang.String MANIFEST_ENTRY
See Also:
Constant Field Values

MANIFEST_ALT_ENTRY

private static final java.lang.String MANIFEST_ALT_ENTRY
See Also:
Constant Field Values

_jarURI

private final java.net.URI _jarURI

_manifestURI

private java.net.URI _manifestURI
Constructor Detail

JARExtensionSource

public JARExtensionSource(java.net.URI jarURI)
Method Detail

getURI

public final java.net.URI getURI()
Get the URI of this JAR file.

Specified by:
getURI in interface ExtensionSource

getClasspathEntry

public final java.net.URI getClasspathEntry()
Description copied from interface: ExtensionSource
Get the classpath entry for this extension source. This is the (optional) entry that should be added to the classpath prior to processing this extension.

Specified by:
getClasspathEntry in interface ExtensionSource

getManifestURI

public java.net.URI getManifestURI()
Get the URI of the manifest file within the extension source.

Specified by:
getManifestURI in interface ExtensionSource

resolvePath

public java.net.URI resolvePath(javax.ide.extension.Extension extension,
                                java.lang.String path)
Resolve a relative path from the manifest file. For JAR sources, the path may either be within the JAR (if the path starts with a /), or relative to the location of the jar file otherwise.

Specified by:
resolvePath in interface ExtensionSource

getName

public java.lang.String getName()
Get the name of this source. This will be used to present the source in human readable messages.

This implementation returns the result of calling VirtualFileSytem.toDisplayString() on the jar URI.

Specified by:
getName in interface ExtensionSource

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: ExtensionSource
Get an input stream for this sources manifest.

Specified by:
getInputStream in interface ExtensionSource