Command line interface - Georgetown-University-Libraries/File-Analyzer GitHub Wiki

The file analyzer can be invoked from a command line.

java -cp demo\target\DemoFileAnalyzer-2.0.jar edu.georgetown.library.fileAnalyzer.DemoBatchAnalyzer -help

Usage:
        BatchAnalyzer [-options] [-root rootdir] [-outfile outfile] filetest
                to process a single directory, writing results to one file
                If absent, rootdir will default to current directory.
                If absent, outfile will be generated
or
        BatchAnalyer [-options] -batchfile batch filetest
                to process a collection of directories
                The batch file is a tab separated file containing:
                        rootdir --> result filenames

where options include
        -outdir    Directory to which output files will be written.
                                Defaults to working directory
        -max       defaults to 500000
        -overwrite      defaults to true
        -listparams     lists the parameters associated with a file test
        -listfilters    lists the filters associated with a file test
        -filter   name of the filter to use.
                                defaults to the first filter

filetest parameters
        -param       Pass filetest specific parameters
                        Multiple param vals may be provided

the following options override filter defaults
        -prefix    Filenames must start with this value
        -suffix    Filenames must end with this value
        -contains  Filenames must contain this value
        -excludes  Filenames may not contain this value

result filtering options
        -rf   Only output results where column  matches 
                        Multiple rf vals may be provided
filetest
        ByType                          Count Files By Type
        Files                           List Files
        DIR                             List Dir
        Name                            Match By Name
        BaseName                        Match By Base Name
        Checksum                        Sort By Checksum
        ReadChecksum                    Read Checksum
        Path                            Match By Path
        TypeDir                         Count By Type and Dir
        Random                          Random Sampling Mil 105E
        Lowercase                       Lowercase Test
        LowercaseRename                 Lowercase Rename
        Deriv                           Digital Derivatives
        IngestInventory                 Ingest Inventory
        IngestValidate                  Ingest Validate
        DSpaceDAT                       DSpaceDAT
        ProQuest                        ProQuest to DSpace Ingest Folder
        ProQuestQC                      ProQuest Metadata QC
        Pg                              Page Count
        Image                           Image Spec
        Yearbook                        Yearbook Test
        Bag                             Create Bag
        APTBag                          Create APTrust Bag
        AIPZip->APT                     Package AIP Zip for APT
        AIPDir->APT                     Package AIP Dir for APT
        VerBag                          Verify Bag - Dir
        VerBagZip                       Verify Bag - Zip
        VerBagTar                       Verify Bag - Tar
        VerAPTTAR                       Verify APTrust Bag - TAR
        Counter                         Counter Compliance
        Demo                            Demo File Test
        ItemInventory                   MARC Item Inventory
        IIIF                            Create IIIF Manifest

Parameters for a specific FileTest can be listed

java -cp demo\target\DemoFileAnalyzer-2.0.jar edu.georgetown.library.fileAnalyzer.DemoBatchAnalyzer -listparams IIIF

Parameters for File Test: Create IIIF Manifest
    manifest-gen-prop                 manifest-gen-prop               Manifest Generation Property Filename
    translate                         translate                       Project Value Translator: if set to Default, use the value in the property file

The import function can also be invoked from the command line.

java -cp demo\target\DemoFileAnalyzer-2.0.jar edu.georgetown.library.fileAnalyzer.DemoBatchImporter -help

Usage:
        BatchImporter [-options] -infile inputfile importer

where options include
        -outdir         Directory to which output files will be written.
                Defaults to working directory
        -outfile        Output file name, defaults to a system generated name
        -max            defaults to 500000
        -overwrite      defaults to true
        -listparams     lists the parameters associated with a file test

importer parameters
        -param       Pass filetest specific parameters
                        Multiple param vals may be provided

importer
                Delim                           Import Delimited File
                Regex                           Regular Expression Parser
                MultiParse                      Multi Parser
                Key                             Count Key
                IngestFolder                    Ingest: Create Ingest Folders
                ItemUpdateAddBitstreams         Ingest: Create Item Update Folders - Add Bitstreams
                ItemUpdateDeleteBitstreams      Ingest: Create Item Update Folders - Delete Bitstreams
                BatchCSV                        Batch CSV File
                Dspace2Marc                     Convert DSpace Metadata to MARC
                MetadataReg                     Read DSpace Metadata Registry
                Counter                         Counter Compliance
                Demo                            Demo Importer
                Marc                            MARC Rec Validator
                Outsourced                      Outsourced MARC Validation
                Encoding                        MARC Encoding Check
                Inventory                       MARC Inventory
                ItemInventory                   MARC Item Inventory
                Serializer                      MARC Serializer

Parameters for a specific Importer can be listed

java -cp demo\target\DemoFileAnalyzer-2.0.jar edu.georgetown.library.fileAnalyzer.DemoBatchImporter -listparams ItemUpdateDeleteBitstreams

UpdateDeleteBitstreams -listparams
Parameters for Importer: Ingest: Create Item Update Folders - Delete Bitstreams
    handle-service-baseurl            handle-service-baseurl          Handle prefix to create match existing item
⚠️ **GitHub.com Fallback** ⚠️