renaming ZUV to library.extended

This commit is contained in:
Jochen Stärk
2020-03-28 18:49:23 +01:00
parent bc7bd254b5
commit 3e606e3cc3
20 changed files with 21 additions and 2614 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -145,12 +145,6 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>ZUV.main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
@@ -174,11 +168,6 @@
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>ZUV.Main</mainClass>
</transformer>
</transformers>
<minimizeJar>false</minimizeJar>
<filters>
<filter>

View File

@@ -1,5 +0,0 @@
package ZUV;
public enum EPart {
xml, pdf, none
}

View File

@@ -1,92 +0,0 @@
package ZUV;
import java.io.File;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sanityinc.jargs.CmdLineParser;
import com.sanityinc.jargs.CmdLineParser.Option;
public class Main {
static final ClassLoader cl = Main.class.getClassLoader();
private static final Logger LOGGER = LoggerFactory.getLogger(Main.class.getCanonicalName()); // log output is
// ignored for the
// time being
public void run(String[] args) {
/***
* prerequisite is a mvn generate-resources
*/
CmdLineParser parser = new CmdLineParser();
Option<String> actionOption = parser.addStringOption('a', "action");
Option<String> filenameOption = parser.addStringOption('f', "Filename");
Option<Boolean> licenseOption = parser.addBooleanOption('l', "license");
Option<Boolean> helpOption = parser.addBooleanOption('h', "help");
boolean optionsRecognized = false;
try {
parser.parse(args);
} catch (CmdLineParser.OptionException e) {
System.err.println(e.getMessage());
System.exit(-2);
}
Boolean helpRequested = parser.getOptionValue(helpOption);
if (parser.getOptionValue(licenseOption) != null) {
optionsRecognized = true;
System.out.println("Copyright 2018 Jochen Stärk\n" + "\n"
+ "Licensed under the Apache License, Version 2.0 (the \"License\");\n"
+ "you may not use this file except in compliance with the License.\n"
+ "You may obtain a copy of the License at\n" + "\n"
+ " http://www.apache.org/licenses/LICENSE-2.0\n" + "\n"
+ "Unless required by applicable law or agreed to in writing, software\n"
+ "distributed under the License is distributed on an \"AS IS\" BASIS,\n"
+ "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
+ "See the License for the specific language governing permissions and\n"
+ "limitations under the License.\n\n\n\n\n"
+ "This software is embedding the PDF/A validator VeraPDF, "
+ "http://verapdf.org/, which is available under GPL and MPL licenses.");
System.exit(0);
}
String filename = parser.getOptionValue(filenameOption);
String action = parser.getOptionValue(actionOption);
File logdir = new File("log");
if (!logdir.exists() || !logdir.isDirectory() || !logdir.canWrite()) {
System.err.println("Need writable subdirectory 'log' for log files.");
}
if ((action != null) && (action.equals("validate"))) {
ZUGFeRDValidator zfv=new ZUGFeRDValidator();
System.out.println(zfv.validate(filename));
optionsRecognized = !zfv.hasOptionsError();
if (!zfv.wasCompletelyValid()) {
System.exit(-1);
}
}
if ((!optionsRecognized) || (helpRequested != null && helpRequested.booleanValue())) {
System.out.println(
"usage: --action validate -f <ZUGFeRD PDF Filename.pdf>|<ZUGFeRD XML Filename.xml> [-l (shows license)]");
System.exit(-1);
}
}
public static void main(String[] args) {
new Main().run(args);
}
}

View File

@@ -0,0 +1,5 @@
package org.mustangproject.library.extended;
public enum EPart {
xml, pdf, none
}

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
public enum ESeverity {
notice, warning, error, fatal, exception

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
public class IrrecoverableValidationError extends Exception {

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.io.File;
import java.io.FileOutputStream;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.util.Vector;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.io.ByteArrayInputStream;
import java.io.IOException;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
public class XMLTools {

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -295,7 +295,7 @@ public class XMLValidator extends Validator {
context.addCustomXML("<info><version>" + ((context.getVersion() != null) ? context.getVersion() : "invalid")
+ "</version><profile>" + ((context.getProfile() != null) ? context.getProfile() : "invalid") +
"</profile><validator version=\""+Main.class.getPackage().getImplementationVersion()+"\"></validator><rules><fired>"+firedRules+"</fired><failed>"+failedRules+"</failed></rules>" + "<duration unit='ms'>" + (endTime - startXMLTime) + "</duration></info>");
"</profile><validator version=\""+XMLValidator.class.getPackage().getImplementationVersion()+"\"></validator><rules><fired>"+firedRules+"</fired><failed>"+failedRules+"</failed></rules>" + "<duration unit='ms'>" + (endTime - startXMLTime) + "</duration></info>");
}

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.io.File;
import java.io.FileInputStream;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.io.BufferedWriter;
import java.io.File;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.io.File;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.io.File;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import static org.xmlunit.assertj.XmlAssert.assertThat;
import java.io.File;

View File

@@ -1,4 +1,4 @@
package ZUV;
package org.mustangproject.library.extended;
import java.io.File;
import java.util.regex.Matcher;