|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.overlord.sramp.atom.archive.SrampArchive
public class SrampArchive
Models the archive format defined in the S-RAMP Atom Binding document.
| Constructor Summary | |
|---|---|
SrampArchive()
Creates a new, empty S-RAMP archive. |
|
SrampArchive(File file)
Creates an S-RAMP archive from an existing archive file. |
|
SrampArchive(InputStream input)
Creates an S-RAMP archive from an InputStream. |
|
| Method Summary | |
|---|---|
void |
addEntry(String path,
BaseArtifactType metaData,
InputStream content)
Adds an entry to the S-RAMP archive. |
void |
close()
The S-RAMP archive should always be closed when the client is done with it. |
static void |
closeQuietly(SrampArchive archive)
Close the archive quietly (eat any IOException). |
boolean |
containsEntry(String archivePath)
Returns true if the s-ramp archive contains an entry at the given path. |
Collection<SrampArchiveEntry> |
getEntries()
Gets all of the entries found in this S-RAMP archive. |
SrampArchiveEntry |
getEntry(String archivePath)
Gets a single entry in the archive by path. |
InputStream |
getInputStream(SrampArchiveEntry entry)
Gets the content InputStream for the given S-RAMP archive entry. |
File |
pack()
Packs up the current contents of the S-RAMP archive into a single (.zip) file and returns a reference to it. |
boolean |
removeEntry(String archivePath)
Removes the s-ramp archive entry at the given path if it exists. |
void |
updateEntry(SrampArchiveEntry entry,
InputStream content)
Updates an existing entry in the S-RAMP archive. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SrampArchive()
throws SrampArchiveException
SrampArchiveException
public SrampArchive(File file)
throws SrampArchiveException
file -
SrampArchiveException
public SrampArchive(InputStream input)
throws SrampArchiveException
InputStream. This will consume and close the
InputStream, creating a temporary local file that will be used as the basis for
the archive input.
input -
SrampArchiveException| Method Detail |
|---|
public void close()
throws IOException
IOExceptionpublic static void closeQuietly(SrampArchive archive)
IOException).
archive -
public Collection<SrampArchiveEntry> getEntries()
throws SrampArchiveException
SrampArchiveException
public InputStream getInputStream(SrampArchiveEntry entry)
throws IOException
InputStream for the given S-RAMP archive entry.
entry - the s-ramp archive entry
InputStream over the artifact content or null if no content found (meta-data only)
IOException
public void addEntry(String path,
BaseArtifactType metaData,
InputStream content)
throws SrampArchiveException
InputStream.
path - the path in the archive (usually just the name of the artifact)metaData - the artifact meta-datacontent - the entry content (or null if a meta-data only entry)
SrampArchiveException
public void updateEntry(SrampArchiveEntry entry,
InputStream content)
throws SrampArchiveException
InputStream.
entry - the archive entry (or null if just udpating the content)content - the entry content (or null if just updating meta data)
SrampArchiveException
public File pack()
throws SrampArchiveException
File. It will never throw and leave a temporary file
behind.
SrampArchiveExceptionpublic SrampArchiveEntry getEntry(String archivePath)
archivePath - the path of the entry within the archive
public boolean containsEntry(String archivePath)
archivePath - path to the entry within the archive
public boolean removeEntry(String archivePath)
archivePath - path to the entry within the archive
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||