View Javadoc

    1   /* BlockFileSystem
    2   *
    3   * Created on September 12, 2006
    4   *
    5   * Copyright (C) 2006 Internet Archive.
    6   *
    7   * This file is part of the Heritrix web crawler (crawler.archive.org).
    8   *
    9   * Heritrix is free software; you can redistribute it and/or modify
    10  * it under the terms of the GNU Lesser Public License as published by
    11  * the Free Software Foundation; either version 2.1 of the License, or
    12  * any later version.
    13  *
    14  * Heritrix is distributed in the hope that it will be useful,
    15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17  * GNU Lesser Public License for more details.
    18  *
    19  * You should have received a copy of the GNU Lesser Public License
    20  * along with Heritrix; if not, write to the Free Software
    21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    22  */
    23  package org.archive.util.ms;
    24
    25  import java.io.IOException;
    26
    27  import org.archive.io.SeekInputStream;
    28
    29
    30  /***
    31   * Describes the internal file system contained in .doc files.
    32   */
    33  public interface BlockFileSystem {
    34
    35
    36      /***
    37       * The size of a block in bytes.
    38       */
    39      int BLOCK_SIZE = 512;
    40
    41
    42      /***
    43       * Returns the root entry of the file system.  Subfiles and directories
    44       * can be found by searching the returned entry.
    45       *
    46       * @return  the root entry
    47       * @throws IOException  if an IO error occurs
    48       */
    49      public abstract Entry getRoot() throws IOException;
    50
    51
    52      /***
    53       * Returns the number of the block that follows the given block.
    54       * The internal block allocation tables are consulted to determine the
    55       * next block.  A return value that is less than zero indicates that
    56       * there is no next block.
    57       *
    58       * @param block   the number of block whose successor to return
    59       * @return  the successor of that block
    60       * @throws IOException  if an IO error occurs
    61       */
    62      public abstract int getNextBlock(int block) throws IOException;
    63
    64
    65      /***
    66       * Returns the raw input stream for this file system.
    67       * Typically this will be the random access file containing the .doc.
    68       *
    69       * @return  the raw input stream for this file system
    70       */
    71      public abstract SeekInputStream getRawInput();
    72
    73  }