Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Piccolo Proof of Concept #616

Draft
wants to merge 1 commit into
base: integration
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions jhove-apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>

<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.3.2</version>
</dependency>
</dependencies>

<profiles>
Expand Down
10 changes: 10 additions & 0 deletions jhove-apps/src/main/java/Jhove.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import edu.harvard.hul.ois.jhove.JhoveBase;
import edu.harvard.hul.ois.jhove.Module;
import edu.harvard.hul.ois.jhove.OutputHandler;
import picocli.CommandLine;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -60,6 +61,15 @@ public static void main(String [] args)
System.exit(ExitCode.INCOMPATIBLE_VM.getReturnCode());
}

// SHORT DEMO and OUT
// Set up config
JhoveConfig config = new JhoveConfig();
// Parse the args passed
new CommandLine(config).parseArgs(args);
// Test the use of -k for checksumming.
System.out.println("Checksum opt is: " + config.isCheckum);
System.exit(0);

try {

// Initialize the application state object.
Expand Down
30 changes: 30 additions & 0 deletions jhove-apps/src/main/java/JhoveConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
*
*/


import java.io.File;

/**
* @author cfw
*
*/
import picocli.CommandLine.Option;
import picocli.CommandLine.Parameters;

public final class JhoveConfig {
// Something like this
// NOTE the --config and other flag additions
@Option(names = { "-c", "--config" },
description = "Path to an alternative jhove config file.")
File config;
@Option(names = { "-k", "--checksum" },
description = "Path to an alternative jhove config file.")
boolean isCheckum;
@Option(names = { "-m", "--module" },
description = "Name of the JHOVE module to invoke.")
String moduleName;
// I'd like to see us go multi file if we can
@Parameters(arity = "0..*", paramLabel = "FILE", description = "Directories, files or URIs to process.")
File[] toProcess;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
* <li><a href="http://jhove.openpreservation.org/">JHOVE home page</a>
* </ul>
*/
package hul.ois.jhove.module.gzip;
package edu.harvard.hul.ois.jhove.module.gzip;
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
* <li><a href="http://jhove.openpreservation.org/">JHOVE home page</a>
* </ul>
*/
package hul.ois.jhove.module.warc;
package edu.harvard.hul.ois.jhove.module.warc;