public class JarContentReference extends ContentReference
This class may be instantiated or subclassed by clients.
Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
ContentReference
,
JarEntryContentReference
Modifier and Type | Class and Description |
---|---|
static class |
JarContentReference.ContentSelector
Content selector used in .jar operations.
|
DEFAULT_EXECUTABLE_PERMISSION, UNKNOWN_SIZE
Constructor and Description |
---|
JarContentReference(String id,
File file)
Create jar content reference from file.
|
JarContentReference(String id,
File file,
boolean b)
Constructor JarContentReference.
|
JarContentReference(String id,
URL url)
Create jar content reference from URL.
|
Modifier and Type | Method and Description |
---|---|
protected JarFile |
asJarFile()
Returns the content reference as a jar file.
|
void |
closeArchive()
Closes the jar archive corresponding to this reference.
|
ContentReference |
createContentReference(String id,
File file)
A factory method to create a jar content reference.
|
ContentReference[] |
peek(JarContentReference.ContentSelector selector,
InstallMonitor monitor)
Peeks into the referenced jar archive.
|
ContentReference |
peek(String entryName,
JarContentReference.ContentSelector selector,
InstallMonitor monitor)
Peeks into the referenced jar archive looking for the named entry.
|
static void |
shutdown()
Perform shutdown processing for jar archive handling.
|
ContentReference[] |
unpack(File dir,
JarContentReference.ContentSelector selector,
InstallMonitor monitor)
Unpacks the referenced jar archive into the specified location.
|
ContentReference |
unpack(File dir,
String entryName,
JarContentReference.ContentSelector selector,
InstallMonitor monitor)
Unpacks the named jar entry into the specified location.
|
asFile, asURL, getIdentifier, getInputSize, getInputStream, getLastModified, getPermission, isLocalReference, setLastModified, setPermission, setTempLocal, toString
public JarContentReference(String id, URL url)
id
- "symbolic" path identifierurl
- actual referenced URLpublic JarContentReference(String id, File file)
id
- "symbolic" path identifierfile
- actual referenced filepublic ContentReference createContentReference(String id, File file)
createContentReference
in class ContentReference
id
- "symbolic" path identifierfile
- actual referenced fileprotected JarFile asJarFile() throws IOException
IOException
- reference cannot be returned as jar filepublic ContentReference[] unpack(File dir, JarContentReference.ContentSelector selector, InstallMonitor monitor) throws IOException, InstallAbortedException
dir
- location to unpack the jar intoselector
- selector, used to select entries to unpack, and to define
"symbolic" path identifiers for the entries.monitor
- progress monitorIOException
InstallAbortedException
public ContentReference unpack(File dir, String entryName, JarContentReference.ContentSelector selector, InstallMonitor monitor) throws IOException, InstallAbortedException
dir
- location to unpack the jar intoentryName
- name of the jar entryselector
- selector, used to define "symbolic" path identifier
for the entrymonitor
- progress monitorIOException
InstallAbortedException
public ContentReference[] peek(JarContentReference.ContentSelector selector, InstallMonitor monitor) throws IOException
selector
- selector, used to select entries to return, and to define
"symbolic" path identifiers for the entries.monitor
- progress monitorIOException
public ContentReference peek(String entryName, JarContentReference.ContentSelector selector, InstallMonitor monitor) throws IOException
entryName
- name of the jar entryselector
- selector, used to define "symbolic" path identifier
for the entrymonitor
- progress monitornull if the entry doesn't exist
IOException
public void closeArchive() throws IOException
IOException
public static void shutdown()
Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.