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 interfaceThe interfaceEntrycontains the wrapper definition for an archive entry. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()The methodcloseprovides means to close the stream.voidThe methodcloseEntryprovides means to close the current entry.getName()The methodgetNameprovides means to retrieve the file name.The methodgetNextEntryprovides means to move to the next entry.The methodgetStreamprovides means to get the InputStream for the current entry.static Archiveof(String name, InputStream in) The methodofprovides means to create a wrapper for an archive file.
-
Method Details
-
of
The methodofprovides 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 or
nullif the file type is not supported
-
close
The methodcloseprovides means to close the stream.- Throws:
IOException- in case of an I/O error
-
closeEntry
The methodcloseEntryprovides means to close the current entry.- Throws:
IOException- in case of an I/O error
-
getName
String getName()The methodgetNameprovides means to retrieve the file name.- Returns:
- the file name or null
-
getNextEntry
The methodgetNextEntryprovides means to move to the next entry.- Returns:
- the next entry
- Throws:
IOException- in case of an I/O error
-
getStream
InputStream getStream()The methodgetStreamprovides means to get the InputStream for the current entry.- Returns:
- the InputStream for the current entry
-