Interface Archive
- All Known Implementing Classes:
TgzArchiveWrapper
,ZipArchiveWrapper
public interface Archive
The interface
Archive
contains the common description for a ZIP
and tar.gz archive.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
The interfaceEntry
contains the wrapper definition for an archive entry. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
The methodclose
provides means to close the stream.void
The methodcloseEntry
provides means to close the current entry.getName()
The methodgetName
provides means to retrieve the file name.The methodgetNextEntry
provides means to move to the next entry.The methodgetStream
provides means to get the InputStream for the current entry.static Archive
of
(@NonNull String name, @NonNull InputStream in) The methodof
provides means to create a wrapper for an archive file.
-
Method Details
-
of
static Archive of(@NonNull @NonNull String name, @NonNull @NonNull InputStream in) throws IOException The methodof
provides means to create a wrapper for an archive file.- Parameters:
name
- the file namein
- the file to wrap- Returns:
- the new archive wrapper for the file
- Throws:
IOException
- in case of an I/O error
-
close
The methodclose
provides means to close the stream.- Throws:
IOException
- in case of an I/O error
-
closeEntry
The methodcloseEntry
provides means to close the current entry.- Throws:
IOException
- in case of an I/O error
-
getName
String getName()The methodgetName
provides means to retrieve the file name.- Returns:
- the file name or null
-
getNextEntry
The methodgetNextEntry
provides means to move to the next entry.- Returns:
- the next entry
- Throws:
IOException
- in case of an I/O error
-
getStream
InputStream getStream()The methodgetStream
provides means to get the InputStream for the current entry.- Returns:
- the InputStream for the current entry
-