Class IndexLoader


  • public class IndexLoader
    extends java.lang.Object
    Load and validate the index of a TAR file.
    • Method Detail

      • newIndexLoader

        public static IndexLoader newIndexLoader​(int blockSize)
        Create a new IndexLoader for the specified block size. The block size is used to validate different data items in the index.
        Parameters:
        blockSize - The block size. It must be strictly positive.
        Returns:
        An instance of IndexLoader.
      • loadIndex

        public Index loadIndex​(ReaderAtEnd reader)
                        throws java.io.IOException,
                               InvalidIndexException
        Load and validate the index. The index is loaded by looking backwards at a TAR file. This method relies on an instance of ReaderAtEnd which is positioned at the end of the index in the TAR file.
        Parameters:
        reader - an instance of ReaderAtEnd.
        Returns:
        An instance of Index.
        Throws:
        java.io.IOException - If an I/O error occurs while reading the index.
        InvalidIndexException - If a validation error occurs while checking the index.