java.lang.Object
iu.type.ArchiveSource
- All Implemented Interfaces:
AutoCloseable
Reads entries from a
JarInputStream
for validating and initializing a
ComponentArchive
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the class path defined in theManifest
.void
close()
(package private) List
<ComponentVersion> Gets the component's dependencies named in theExtension-List
manifest main attributes
.(package private) boolean
hasNext()
Same behavior asIterator.hasNext()
, but can throwIOException
if there is an error reading from the jar file.(package private) ComponentEntry
next()
Same behavior asIterator.next()
, but can throwIOException
if there is an error reading from the jar file.(package private) boolean
sealed()
If packages in this archive should be sealed.toString()
-
Constructor Details
-
ArchiveSource
ArchiveSource(InputStream in) throws IOException Constructs anArchiveSource
for anInputStream
.The input stream provided is opened and validated as a jar file with a valid manifest. The source is considered sealed if
Sealed
appears in the manifest. If the manifest provides a class path or extension list, those attributes are processed.- Parameters:
in
- input stream; this method is not responsible for closing the stream- Throws:
IOException
- If an I/O error occurs
-
-
Method Details
-
sealed
boolean sealed()If packages in this archive should be sealed.- Returns:
- true if packages should be sealed; else false
-
classPath
Gets the class path defined in theManifest
. -
dependencies
List<ComponentVersion> dependencies()Gets the component's dependencies named in theExtension-List
manifest main attributes
.- Returns:
- dependency versions
-
hasNext
Same behavior asIterator.hasNext()
, but can throwIOException
if there is an error reading from the jar file.Note that this method closes the last entry returned from
next()
and positions the jar file for reading the next entry as part of determining whether or not there is a next entry. So, this should only be called after all interactions with the last entry are complete.- Returns:
- see
Iterator.hasNext()
- Throws:
IOException
- If there is an error reading the next entry from the jar file.
-
next
Same behavior asIterator.next()
, but can throwIOException
if there is an error reading from the jar file.- Returns:
- see
Iterator.next()
- Throws:
IOException
- fromhasNext()
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
toString
-