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 Classes
    Modifier and Type
    Interface
    Description
    static interface 
    The interface Entry contains the wrapper definition for an archive entry.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The method close provides means to close the stream.
    void
    The method closeEntry provides means to close the current entry.
    The method getName provides means to retrieve the file name.
    The method getNextEntry provides means to move to the next entry.
    The method getStream provides means to get the InputStream for the current entry.
    static Archive
    of(@NonNull String name, @NonNull InputStream in)
    The method of 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 method of provides means to create a wrapper for an archive file.
      Parameters:
      name - the file name
      in - the file to wrap
      Returns:
      the new archive wrapper for the file
      Throws:
      IOException - in case of an I/O error
    • close

      void close() throws IOException
      The method close provides means to close the stream.
      Throws:
      IOException - in case of an I/O error
    • closeEntry

      void closeEntry() throws IOException
      The method closeEntry provides means to close the current entry.
      Throws:
      IOException - in case of an I/O error
    • getName

      String getName()
      The method getName provides means to retrieve the file name.
      Returns:
      the file name or null
    • getNextEntry

      Archive.Entry getNextEntry() throws IOException
      The method getNextEntry 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 method getStream provides means to get the InputStream for the current entry.
      Returns:
      the InputStream for the current entry