Class ARCUtils
java.lang.Object
org.archive.io.arc.ARCUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisCompressed(File arcFile) static StringparseArcFilename(String pathOrUri) static booleantestCompressedARCFile(File arcFile) Check file is compressed and in ARC GZIP format.static booleantestCompressedARCFile(File arcFile, boolean skipSuffixCheck) Check file is compressed and in ARC GZIP format.static booleanTests passed stream is gzip stream by reading in the HEAD.static booleanTests passed stream is gzip stream by reading in the HEAD.static booleanTests passed stream is gzip stream by reading in the HEAD.static booleantestUncompressedARCFile(File arcFile) Check file is uncompressed ARC file.
-
Constructor Details
-
ARCUtils
public ARCUtils()
-
-
Method Details
-
parseArcFilename
- Parameters:
pathOrUri- Path or URI to extract arc filename from.- Returns:
- Extracted arc file name.
- Throws:
URISyntaxException
-
isCompressed
- Parameters:
arcFile- File to test.- Returns:
- True if
arcFileis compressed ARC. - Throws:
IOException
-
testCompressedARCFile
Check file is compressed and in ARC GZIP format.- Parameters:
arcFile- File to test if its Internet Archive ARC file GZIP compressed.- Returns:
- True if this is an Internet Archive GZIP'd ARC file (It begins w/ the Internet Archive GZIP header and has the COMPRESSED_ARC_FILE_EXTENSION suffix).
- Throws:
IOException- If file does not exist or is not unreadable.
-
testCompressedARCFile
public static boolean testCompressedARCFile(File arcFile, boolean skipSuffixCheck) throws IOException Check file is compressed and in ARC GZIP format.- Parameters:
arcFile- File to test if its Internet Archive ARC file GZIP compressed.skipSuffixCheck- Set to true if we're not to test on the '.arc.gz' suffix.- Returns:
- True if this is an Internet Archive GZIP'd ARC file (It begins w/ the Internet Archive GZIP header).
- Throws:
IOException- If file does not exist or is not unreadable.
-
testCompressedARCStream
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.- Returns:
- True if compressed stream.
- Throws:
IOException
-
testCompressedRepositionalStream
Tests passed stream is gzip stream by reading in the HEAD. Does reposition of stream when done.- Parameters:
rs- An InputStream that is Repositionable.- Returns:
- True if compressed stream.
- Throws:
IOException
-
testCompressedStream
Tests passed stream is gzip stream by reading in the HEAD. Does reposition of stream when done.- Parameters:
is- An InputStream.- Returns:
- True if compressed stream.
- Throws:
IOException
-
testUncompressedARCFile
Check file is uncompressed ARC file.- Parameters:
arcFile- File to test if its Internet Archive ARC file uncompressed.- Returns:
- True if this is an Internet Archive ARC file.
- Throws:
IOException- If file does not exist or is not unreadable.
-