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

Issue #19: Add PDS Core library from PDSEN repo #25

Merged
merged 3 commits into from
Jun 27, 2019
Merged
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
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# PDS4 Validate Tool
Project containing software for validating PDS4 products and PDS3 volumes.
The software is packaged in a JAR file with a command-line wrapper script
to execute validation.

# Dependencies
Two dependencies for this tool are not yet in Maven Central repository so they will need to be installed in your local maven repository in order to build and compile.

## PDS3 Product Tools
1. Go to https://github.com/NASA-PDS-Incubator/pds3-product-tools/releases/latest
2. Clone the tagged branch
3. Run `mvn install` to install the package in your local maven repo.

## PDS4 Parser
1. Go to https://github.com/NASA-PDS-Incubator/pds4-parser-java/releases/latest
2. Clone the tagged branch
3. Run `mvn install` to install the package in your local maven repo.


# Build
The software can be compiled and built with the "mvn compile" command but in order
to create the JAR file, you must execute the "mvn compile jar:jar" command.

In order to create a complete distribution package, execute the
following commands:

% mvn site
% mvn package


# Documentation
The documentation including release notes, installation and operation of the
software should be online at
https://pds-engineering.jpl.nasa.gov/development/pds4/current/preparation/validate/. If it is not
accessible, you can execute the "mvn site:run" command and view the
documentation locally at http://localhost:8080.
16 changes: 0 additions & 16 deletions README.txt

This file was deleted.

158 changes: 122 additions & 36 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ POSSIBILITY OF SUCH DAMAGE.
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand All @@ -90,6 +95,7 @@ POSSIBILITY OF SUCH DAMAGE.
</execution>
</executions>
<configuration>
<revisionOnScmFailure>unknownbuild</revisionOnScmFailure>
<format>{0,date,yyyy-MM-dd HH:mm:ss}</format>
<items>
<item>timestamp</item>
Expand Down Expand Up @@ -117,44 +123,22 @@ POSSIBILITY OF SUCH DAMAGE.
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<!-- Hosts the PDS and OODT artifacts. -->
<repository>
<id>pds-repo</id>
<name>PDS Maven Repository</name>
<url>https://pds-cm.jpl.nasa.gov/maven2</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>gov.nasa.pds.2010.preparation</groupId>
<artifactId>core</artifactId>
<version>${core-version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>saxon</groupId>
<artifactId>saxon</artifactId>
<version>9.2</version>
<scope>compile</scope>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.4.0.7</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
Expand Down Expand Up @@ -192,17 +176,119 @@ POSSIBILITY OF SUCH DAMAGE.
<groupId>com.jamesmurty.utils</groupId>
<artifactId>java-xmlbuilder</artifactId>
<version>1.2</version>
</dependency>
</dependency>
<dependency>
<groupId>commons-chain</groupId>
<artifactId>commons-chain</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.16</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>gov.nasa.pds.preparation</groupId>
<artifactId>pds4-parser</artifactId>
<version>${pds4-parser.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>gov.nasa.jpl.ammos.ids.vicario</groupId>
<artifactId>vicario</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>gov.nasa.pds</groupId>
<artifactId>pds3-product-tools</artifactId>
<version>${pds3-product-tools.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>

<!-- Project Information and Reports inherited from parent. -->
<!-- Dummy SCM repo to handle issue with Maven 2 and Java 9-->
<scm>
<connection>scm:svn:http://127.0.0.1/dummy</connection>
<developerConnection>scm:svn:https://127.0.0.1/dummy</developerConnection>
<tag>HEAD</tag>
<url>http://127.0.0.1/dummy</url>
</scm>

<reporting>
<!-- Project Reports not inherited from parent. -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>dependencies</report>
<report>issue-management</report>
<report>licenses</report>
<report>mailing-lists</report>
<report>team</report>
<report>summary</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<source>1.8</source>
<failOnError>false</failOnError>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
</plugins>
</reporting>
<properties>
<pds4-parser.version>1.0.0</pds4-parser.version>
<pds3-product-tools.version>4.0.0</pds3-product-tools.version>
</properties>
</project>
118 changes: 118 additions & 0 deletions src/main/java/gov/nasa/pds/tools/inventory/reader/InventoryEntry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Copyright 2006-2017, by the California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
// Any commercial use must be negotiated with the Office of Technology Transfer
// at the California Institute of Technology.
//
// This software is subject to U. S. export control laws and regulations
// (22 C.F.R. 120-130 and 15 C.F.R. 730-774). To the extent that the software
// is subject to U.S. export control laws and regulations, the recipient has
// the responsibility to obtain export licenses or other export authority as
// may be required before exporting such information to foreign countries or
// providing access to foreign nationals.
//
// $Id: InventoryEntry.java 8162 2010-11-10 22:05:09Z mcayanan $
package gov.nasa.pds.tools.inventory.reader;

import java.io.File;

/**
* Class representation of a single entry in a PDS Inventory file.
*
* @author mcayanan
*
*/
public class InventoryEntry {
/** A product file. */
private File file;

/** A checksum. */
private String checksum;

/** A logical identifier. */
private String identifier;

/** Member status. */
private String memberStatus;

/** Default constructor */
public InventoryEntry() {
this.file = null;
this.checksum = "";
this.identifier = "";
this.memberStatus = "";
}

/**
* Constructor.
*
* @param identifier logical identifier.
* @param memberStatus member status.
*/
public InventoryEntry(String identifier, String memberStatus) {
this(null, "", identifier, memberStatus);
}

/**
* Constructor.
*
* @param file A product file.
* @param checksum checksum.
* @param identifier logical identifier.
*/
public InventoryEntry(File file, String checksum, String identifier, String memberStatus) {
this.file = file;
this.checksum = checksum;
this.identifier = identifier;
this.memberStatus = memberStatus;
}

/**
* Gets the file.
*
* @return The file.
*/
public File getFile() {
return file;
}

/**
* Gets the checksum.
*
* @return Checksum value.
*/
public String getChecksum() {
return checksum;
}

/**
* Gets the logical identifier.
*
* @return A LID or LIDVID.
*/
public String getIdentifier() {
return identifier;
}

/**
* Gets the member status.
*
* @return "P", "Primary", "S", or "Secondary"
*/
public String getMemberStatus() {
return memberStatus;
}

/**
* Determines whether the object is empty.
*
* @return true if the object is empty, false otherwise.
*/
public boolean isEmpty() {
if (this.file == null && this.checksum.isEmpty()
&& this.identifier.isEmpty() && this.memberStatus.isEmpty()) {
return true;
} else {
return false;
}
}
}
Loading