Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


oracle.jdeveloper.deploy
Interface Archive

All Superinterfaces:
Copyable
All Known Implementing Classes:
DefaultArchive, DeploymentModule

public interface Archive
extends Copyable

Interface to an Archive object.


Field Summary
static java.util.Comparator ARCHIVE_ENTRY_NAME_COMPARATOR
           
static int BUFFER_SIZE
           

 

Method Summary
 void addContents(ArchiveEntry archiveEntry)
           
 void addContents(ArchiveEntry[] archiveEntries)
          Fills in the manifest with all necessary information provided by the ArchiveEntry array passed in.
 void addContents(java.util.Collection archiveEntries)
          Fills in the manifest with all necessary information provided by the Collection of ArchiveEntry instances passed in.
 void addContents(java.util.Collection archiveEntries, java.lang.String entryNamePrefix)
          Fills in the manifest with all necessary information provided by the Collection of ArchiveEntry instances passed in.
 void addDirectoryTrees(java.net.URL[] dirs, java.lang.String entryNamePrefix)
           
 boolean containsEntry(java.lang.String entryName)
           
 java.util.Iterator<ArchiveEntry> getArchiveEntries()
          Returns an iterator to the contents that have been added to the Archive instance so far.
 int getCompressionLevel()
          Return the desired compression level.
 ArchiveEntry getEntryByName(java.lang.String entryName)
          Get a handle to an ArchiveEntry by its name.
 java.lang.String getMainAttribute(java.lang.String attrName)
          Returns the specified main attribute from the jar's manifest file.
 java.util.jar.Manifest getManifest()
          Returns the current Manifest.
 java.lang.String getManifestAsString()
          Returns the current Manfiest as a String.
 java.util.SortedSet getMissingEntryNames()
          Returns a SortedSet of entry names corresponding to entries which could not be found (i.e.
 boolean hasContents()
          Returns whether the written jar file had any contents.
 boolean isCompressed()
           
 boolean isIncludeManifest()
           
 void mergeManifest(java.util.jar.Manifest manifest)
          Merges the given Manifest with the manifest currently held by Archive.
 void mergeManifest(java.net.URL manifestURL)
          Merge the manifest at the specified URL.
 ArchiveEntry removeEntry(java.lang.String entryName)
           
 ArchiveEntry renameEntry(java.lang.String fromName, java.lang.String toName)
          Change the name of an ArchiveEntry.
 void setCompressed(boolean compressed)
          Sets whether the jar file that is written out should be compressed.
 void setCompressionLevel(int level)
          Set the desired compression level.
 void setCreatedBy(java.lang.String creator)
          Sets the Created-By main attribute for the manifest file.
 void setIncludeManifest(boolean includeManifest)
           
 void setMainAttribute(java.lang.String attrName, java.lang.String attrValue)
          Sets the specified main attribute for the jar's manifest file.
 void setMainClass(java.lang.String mainClass)
          Sets the Main-Class main attribute for the manifest file.
 void setReportNameCollisions(boolean reportNameCollisions)
           

 

Methods inherited from interface oracle.javatools.util.Copyable
copyTo

 

Field Detail

BUFFER_SIZE

static final int BUFFER_SIZE
See Also:
Constant Field Values

ARCHIVE_ENTRY_NAME_COMPARATOR

static final java.util.Comparator ARCHIVE_ENTRY_NAME_COMPARATOR

Method Detail

getManifest

java.util.jar.Manifest getManifest()
Returns the current Manifest.

getManifestAsString

java.lang.String getManifestAsString()
                                     throws java.io.IOException
Returns the current Manfiest as a String. If there is no manifest, null is returned.
Throws:
java.io.IOException - if an I/O exception occurs while converting the manifest contents to String.

setCreatedBy

void setCreatedBy(java.lang.String creator)
Sets the Created-By main attribute for the manifest file.

If creator is null, then the Created-By attribute is removed from the manifest.


getMainAttribute

java.lang.String getMainAttribute(java.lang.String attrName)
Returns the specified main attribute from the jar's manifest file. Returns null if the attribute does not exist. Throws IllegalArgumentException if the attribute name is not formatted properly.

setMainAttribute

void setMainAttribute(java.lang.String attrName,
                      java.lang.String attrValue)
Sets the specified main attribute for the jar's manifest file. If attrName is null this method does nothing. If attrValue is null then the specified attribute is removed from the manifest's main attributes section.

setMainClass

void setMainClass(java.lang.String mainClass)
Sets the Main-Class main attribute for the manifest file. The Main-Class attribute allows a jar file to be used on the command line to launch an application, so that you can launch the application with a command like java -jar MyApp.jar.

If mainClass is null, then the Main-Class attribute is removed from the manifest.


setCompressed

void setCompressed(boolean compressed)
Sets whether the jar file that is written out should be compressed.

setCompressionLevel

void setCompressionLevel(int level)
Set the desired compression level.
Parameters:
level - the compression level, -1 or 0-9
See Also:
Deflater

isIncludeManifest

boolean isIncludeManifest()

setIncludeManifest

void setIncludeManifest(boolean includeManifest)

setReportNameCollisions

void setReportNameCollisions(boolean reportNameCollisions)

mergeManifest

void mergeManifest(java.util.jar.Manifest manifest)
Merges the given Manifest with the manifest currently held by Archive.

mergeManifest

void mergeManifest(java.net.URL manifestURL)
                   throws java.io.IOException
Merge the manifest at the specified URL.
Throws:
java.io.IOException

addContents

void addContents(java.util.Collection archiveEntries,
                 java.lang.String entryNamePrefix)
Fills in the manifest with all necessary information provided by the Collection of ArchiveEntry instances passed in. This Collection is traversed in the order provided by its Iterator. Before the collection of ArchiveEntrys is processed, the given entryNamePrefix is prepended to each ArchiveEntry's entryName. This provides a convenient way of adding a collection of content to a particular directory tree within the archive (e.g. "WEB-INF/classes/"). If the entryNamePrefix represents a directory, it must end with a forward-slash ("/"), because there is no automatic insertion of any intermediate character during the prepending.

addContents

void addContents(java.util.Collection archiveEntries)
Fills in the manifest with all necessary information provided by the Collection of ArchiveEntry instances passed in. This Collection is traversed in the order provided by its Iterator.

addContents

void addContents(ArchiveEntry archiveEntry)

containsEntry

boolean containsEntry(java.lang.String entryName)

removeEntry

ArchiveEntry removeEntry(java.lang.String entryName)

addContents

void addContents(ArchiveEntry[] archiveEntries)
Fills in the manifest with all necessary information provided by the ArchiveEntry array passed in.

addDirectoryTrees

void addDirectoryTrees(java.net.URL[] dirs,
                       java.lang.String entryNamePrefix)

getArchiveEntries

java.util.Iterator<ArchiveEntry> getArchiveEntries()
Returns an iterator to the contents that have been added to the Archive instance so far.

getMissingEntryNames

java.util.SortedSet getMissingEntryNames()
Returns a SortedSet of entry names corresponding to entries which could not be found (i.e. their URL is null). This information is based on the entries that have been added through one of the addContent() methods up to the point in time that getMissingEntryNames() is called. If no entries are missing, an empty SortedSet is returned.

getEntryByName

ArchiveEntry getEntryByName(java.lang.String entryName)
Get a handle to an ArchiveEntry by its name. Example; ArchiveEntry e = archive.getEntryByName("WEB-INF/web.xml");
Parameters:
entryName -
Returns:
ArchiveEntry if found, null if not found.

renameEntry

ArchiveEntry renameEntry(java.lang.String fromName,
                         java.lang.String toName)
Change the name of an ArchiveEntry. This may be equivalent to doing a removeEntry(String) and an addContents(ArchiveEntry) depending on the implementation.
Parameters:
fromName -
toName -
Returns:
the new ArchiveEntry if successfully renamed, null if fromName not found, or if fromName and toName are equal. For performance reasons, this method will not check if toName already exists, it will be silently overwritten.

hasContents

boolean hasContents()
Returns whether the written jar file had any contents. If the jar file has not yet been written (via one of the writeJarFile() methods), then this will return false.

isCompressed

boolean isCompressed()

getCompressionLevel

int getCompressionLevel()
Return the desired compression level.
Returns:
See Also:
Deflater

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


Copyright © 1997, 2015, Oracle. All rights reserved.