| java.lang.Object org.archive.io.ArchiveReaderFactory org.archive.io.arc.ARCReaderFactory
ARCReaderFactory | public class ARCReaderFactory extends ArchiveReaderFactory implements ARCConstants(Code) | | Factory that returns an ARCReader.
Can handle compressed and uncompressed ARCs.
author: stack |
Constructor Summary | |
protected | ARCReaderFactory() Shutdown any access to default constructor. |
Method Summary | |
public static ARCReader | get(String arcFileOrUrl) | public static ARCReader | get(String arcFileOrUrl, long offset) | public static ARCReader | get(File f) | public static ARCReader | get(File f, long offset) | public static ARCReader | get(File f, boolean skipSuffixTest, long offset) Parameters: f - An arcfile to read. Parameters: skipSuffixTest - Set to true if want to test that ARC has propersuffix. | public static ArchiveReader | get(String s, InputStream is, boolean atFirstRecord) | public static ARCReader | get(URL arcUrl, long offset) Get an ARCReader aligned at offset . | public static ARCReader | get(URL arcUrl) Get an ARCReader.
Pulls the ARC local into whereever the System Property
java.io.tmpdir points. | protected ArchiveReader | getArchiveReader(File f, long offset) | protected ArchiveReader | getArchiveReader(File arcFile, boolean skipSuffixTest, long offset) | protected ArchiveReader | getArchiveReader(String arc, InputStream is, boolean atFirstRecord) | public static boolean | isARCSuffix(String arcName) | public boolean | isCompressed(File arcFile) Parameters: arcFile - File to test. | public static boolean | testCompressedARCFile(File arcFile) Check file is compressed and in ARC GZIP format.
Parameters: arcFile - File to test if its Internet Archive ARC fileGZIP compressed. | public static boolean | testCompressedARCFile(File arcFile, boolean skipSuffixCheck) Check file is compressed and in ARC GZIP format.
Parameters: arcFile - File to test if its Internet Archive ARC fileGZIP compressed. Parameters: skipSuffixCheck - Set to true if we're not to test on the'.arc.gz' suffix. | public static boolean | testCompressedARCStream(InputStream is) Tests passed stream is gzip stream by reading in the HEAD.
Does not reposition the stream. |
ARCReaderFactory | protected ARCReaderFactory()(Code) | | Shutdown any access to default constructor.
|
get | public static ARCReader get(File f, boolean skipSuffixTest, long offset) throws IOException(Code) | | Parameters: f - An arcfile to read. Parameters: skipSuffixTest - Set to true if want to test that ARC has propersuffix. Use this method and pass false to open ARCswith the .open or otherwise suffix. Parameters: offset - Have returned ARCReader set to start reading at passedoffset. An ARCReader. throws: IOException - |
get | public static ARCReader get(URL arcUrl, long offset) throws IOException(Code) | | Get an ARCReader aligned at offset . This version of get
will not bring the ARC local but will try to stream across the net making
an HTTP 1.1 Range request on remote http server (RFC1435 Section 14.35).
Parameters: arcUrl - HTTP URL for an ARC (All ARCs considered remote). Parameters: offset - Offset into ARC at which to start fetching. An ARCReader aligned at offset. throws: IOException - |
get | public static ARCReader get(URL arcUrl) throws IOException(Code) | | Get an ARCReader.
Pulls the ARC local into whereever the System Property
java.io.tmpdir points. It then hands back an ARCReader that
points at this local copy. A close on this ARCReader instance will
remove the local copy.
Parameters: arcUrl - An URL that points at an ARC. An ARCReader. throws: IOException - |
isARCSuffix | public static boolean isARCSuffix(String arcName)(Code) | | |
isCompressed | public boolean isCompressed(File arcFile) throws IOException(Code) | | Parameters: arcFile - File to test. True if arcFile is compressed ARC. throws: IOException - |
testCompressedARCFile | public static boolean testCompressedARCFile(File arcFile) throws IOException(Code) | | Check file is compressed and in ARC GZIP format.
Parameters: arcFile - File to test if its Internet Archive ARC fileGZIP compressed. True if this is an Internet Archive GZIP'd ARC file (It beginsw/ the Internet Archive GZIP header and has theCOMPRESSED_ARC_FILE_EXTENSION suffix). exception: IOException - If file does not exist or is not unreadable. |
testCompressedARCFile | public static boolean testCompressedARCFile(File arcFile, boolean skipSuffixCheck) throws IOException(Code) | | Check file is compressed and in ARC GZIP format.
Parameters: arcFile - File to test if its Internet Archive ARC fileGZIP compressed. Parameters: skipSuffixCheck - Set to true if we're not to test on the'.arc.gz' suffix. True if this is an Internet Archive GZIP'd ARC file (It beginsw/ the Internet Archive GZIP header). exception: IOException - If file does not exist or is not unreadable. |
testCompressedARCStream | public static boolean testCompressedARCStream(InputStream is) throws IOException(Code) | | Tests passed stream is gzip stream by reading in the HEAD.
Does not reposition the stream. That is left up to the caller.
Parameters: is - An InputStream. True if compressed stream. throws: IOException - |
Methods inherited from org.archive.io.ArchiveReaderFactory | protected void addUserAgent(HttpURLConnection connection)(Code)(Java Doc) protected InputStream asRepositionable(InputStream is)(Code)(Java Doc) public static ArchiveReader get(String arcFileOrUrl) throws MalformedURLException, IOException(Code)(Java Doc) public static ArchiveReader get(File f) throws IOException(Code)(Java Doc) public static ArchiveReader get(File f, long offset) throws IOException(Code)(Java Doc) public static ArchiveReader get(String s, InputStream is, boolean atFirstRecord) throws IOException(Code)(Java Doc) public static ArchiveReader get(URL u, long offset) throws IOException(Code)(Java Doc) public static ArchiveReader get(URL u) throws IOException(Code)(Java Doc) protected ArchiveReader getArchiveReader(String arcFileOrUrl) throws MalformedURLException, IOException(Code)(Java Doc) protected ArchiveReader getArchiveReader(String arcFileOrUrl, long offset) throws MalformedURLException, IOException(Code)(Java Doc) protected ArchiveReader getArchiveReader(File f) throws IOException(Code)(Java Doc) protected ArchiveReader getArchiveReader(File f, long offset) throws IOException(Code)(Java Doc) protected ArchiveReader getArchiveReader(String id, InputStream is, boolean atFirstRecord) throws IOException(Code)(Java Doc) protected ArchiveReader getArchiveReader(URL f, long offset) throws IOException(Code)(Java Doc) protected ArchiveReader getArchiveReader(URL u) throws IOException(Code)(Java Doc) protected boolean isCompressed(File f) throws IOException(Code)(Java Doc) protected ArchiveReader makeARCLocal(URLConnection connection) throws IOException(Code)(Java Doc)
|
|
|