Note that this documentation is for the old 5.2 release.
For the newest documentation, please see the current release documentation.

Tools in the Common Module

Contents

logback.xml disabling logs to stdout:

Currently our tools have by-default log entries written to stdout. To disable this create a logback.xml with the following content

<configuration> 
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<root level="OFF"/> 
</configuration>

and refer to this file with

-Dlogback.configurationFile=/path/to/logback.xml

dk.netarkivet.common.tools.ArcMerge (deprecated)

This tool takes as input several arcfiles, and inserts all the records of the input arcfiles into a single arcfile. This arcfile is currently dumped to stdout, but can of course be redirected to a file.  Deprecated  because it only handles ARCfiles. use JWAT-tools instead.

Usage

export CLASSPATH=/path/to/installdir/lib/netarchivesuite-common-core.jar
export LOG=-Dlogback.configurationFile=/path/to/logback.xml
java $LOG dk.netarkivet.common.tools.ArcMerge arcfile1.arc arcfile2.arc > resulting.arc

dk.netarkivet.common.tools.ArcWrap (deprecated)

This tool takes an input file, an URI for this file, and a mime-type for this file, and creates an ARC-file with only one ARCRecord, which has the input file as contents, and with the given mimetype and URI. The ARCfile is written to stdout, but can of course be redirected to a file. Deprecated  because it only generates ARC-files

usage

export CLASSPATH=/path/to/installdir/lib/netarchivesuite-common-core.jar
export LOG=-Dlogback.configurationFile=/path/to/logback.xml
java $LOG dk.netarkivet.common.tools.ArcWrap input_file uri mime-type > myarchive.arc

dk.netarkivet.common.tools.ArchiveExtractCDX

This tool generates CDX-entries for all records in the given  (W)ARC-files, and prints the CDX'es to stdout, but can of course be redirected to a file like we show below.

usage

export CLASSPATH=/path/to/installdir/lib/netarchivesuite-common-core.jar
export LOG=-Dlogback.configurationFile=/path/to/logback.xml
java $LOG dk.netarkivet.common.tools.ArchiveExtractCDX [arcfile]+ > output.cdx

dk.netarkivet.common.tools.WriteBytesToFile

This tool makes large files primarily for testing purposes. The tool needs two arguments, the number of bytes that must be written (nbytes), and the name of the file to write to. The number of bytes must be > chunksize (currently 10000000), otherwise 0 bytes will be written to the file.

usage

export CLASSPATH=/path/to/installdir/lib/netarchivesuite-common-core.jar
export LOG=-Dlogback.configurationFile=/path/to/logback.xml
java $LOG dk.netarkivet.common.tools.WriteBytesToFile nbytes filename

 

 

 

Â