Class WARCReaderFactory
java.lang.Object
org.archive.io.ArchiveReaderFactory
org.archive.io.warc.WARCReaderFactory
Factory for WARC Readers.
Figures whether to give out a compressed file Reader or an uncompressed
Reader.
- Version:
- $Date: 2006-08-23 17:59:04 -0700 (Wed, 23 Aug 2006) $ $Version$
- Author:
- stack
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassCompressed WARC file reader.classUncompressed WARC file reader. -
Method Summary
Modifier and TypeMethodDescriptionstatic WARCReaderstatic WARCReaderstatic WARCReaderstatic ArchiveReaderget(String s, InputStream is, boolean atFirstRecord) static WARCReaderGet an ARCReader.static WARCReaderprotected ArchiveReadergetArchiveReader(File f, long offset) protected ArchiveReadergetArchiveReader(String f, InputStream is, boolean atFirstRecord) static booleanstatic booleanCheck file is compressed WARC.Methods inherited from class org.archive.io.ArchiveReaderFactory
addUserAgent, getArchiveReader, getArchiveReader, getArchiveReader, getArchiveReader, getArchiveReader, isCompressed, makeARCLocal
-
Method Details
-
get
- Throws:
MalformedURLExceptionIOException
-
get
- Throws:
IOException
-
get
- Parameters:
f- An arcfile to read.offset- Have returned Reader set to start reading at this offset.- Returns:
- A WARCReader.
- Throws:
IOException
-
getArchiveReader
- Overrides:
getArchiveReaderin classArchiveReaderFactory- Throws:
IOException
-
get
- Throws:
IOException
-
getArchiveReader
protected ArchiveReader getArchiveReader(String f, InputStream is, boolean atFirstRecord) throws IOException - Overrides:
getArchiveReaderin classArchiveReaderFactory- Throws:
IOException
-
get
- Throws:
IOException
-
get
Get an ARCReader. Pulls the ARC local into whereever the System Propertyjava.io.tmpdirpoints. 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.- Returns:
- An ARCReader.
- Throws:
IOException
-
testCompressedWARCFile
Check file is compressed WARC.- Parameters:
f- File to test.- Returns:
- True if this is compressed WARC (TODO: Just tests if file is GZIP'd file (It begins w/ GZIP MAGIC)).
- Throws:
IOException- If file does not exist or is not unreadable.
-
isWARCSuffix
-