Modifier and Type | Field and Description |
---|---|
static String |
RESPONSETEXT
Extra ARC Record metadata.
|
Modifier and Type | Method and Description |
---|---|
static org.archive.io.arc.ARCWriter |
createARCWriter(File newFile)
Create new ARCWriter, writing to arcfile newFile.
|
static Map<String,Object> |
getHeadersFromARCFile(InputStream in,
Long offset)
TODO write unit test.
|
static org.archive.io.arc.ARCWriter |
getToolsARCWriter(PrintStream stream,
File destinationArcfile)
Return an ARCWriter suitable for the tools ArcMerge and ArcWrap.
|
static void |
insertARCFile(File arcFile,
org.archive.io.arc.ARCWriter aw)
Insert the contents of an ARC file (skipping an optional initial filedesc: header) in another ARCfile.
|
static boolean |
isARC(String filename)
Check if the filename belongs to an ARC file.
|
static byte[] |
readARCRecord(org.archive.io.arc.ARCRecord in)
Read the contents of an ARC record into a byte array.
|
static void |
writeFileToARC(org.archive.io.arc.ARCWriter aw,
File file,
String uri,
String mime)
Write a file to an ARC file.
|
public static final String RESPONSETEXT
public static void insertARCFile(File arcFile, org.archive.io.arc.ARCWriter aw)
arcFile
- An ARC file to read.aw
- A place to write the arc recordsIOFailure
- if there are problems reading the file.public static org.archive.io.arc.ARCWriter createARCWriter(File newFile)
newFile
- the ARCfile, that the ARCWriter writes to.public static void writeFileToARC(org.archive.io.arc.ARCWriter aw, File file, String uri, String mime)
aw
- The ARCWriter doing the writingfile
- The file we want to write to the ARC fileuri
- The uri for the ARCRecord being writtenmime
- The mimetype for the ARCRecord being writtenArgumentNotValid
- if any arguments aw and file are null and arguments uri and mime are null or empty.public static org.archive.io.arc.ARCWriter getToolsARCWriter(PrintStream stream, File destinationArcfile) throws IOException
stream
- the given PrintStream.destinationArcfile
- the given destination ARC file.IOException
- redirect from ARCWriter constructurepublic static byte[] readARCRecord(org.archive.io.arc.ARCRecord in) throws IOException
in
- An ARC record to read from. After reading, the ARC Record will no longer have its own data available
for reading.IOException
- If there is an error reading the data, or if the record is longer than Integer.MAX_VALUE
(since we can't make bigger arrays).public static Map<String,Object> getHeadersFromARCFile(InputStream in, Long offset) throws IOException
in
- pointing at start of ARC record.offset
- into ARC file.IOException
- if fails to read ARC files or ARC files isn't valid.Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.