Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public class PolicyGenerator {
private static final String HELP = "[options] <FILE>\n Options:";
private static final Logger logger = Logger.getLogger(PolicyGenerator.class.getCanonicalName());
private static final Logger LOGGER = Logger.getLogger(PolicyGenerator.class.getCanonicalName());
private Document document;
private StringBuilder content;
private String fileName;
Expand Down Expand Up @@ -83,7 +83,7 @@ public static void main(String[] args) {
generator.customProfile = Profiles.profileFromXml(is);
} catch (JAXBException | FileNotFoundException e) {
generator.customProfile = null;
logger.log(Level.WARNING, "Error while getting profile from xml file. The profile will be selected automatically");
LOGGER.log(Level.WARNING, "Error while getting profile from xml file. The profile will be selected automatically");
} catch (IOException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -170,7 +170,7 @@ private void validate() throws IOException {
null, null, fixConf, EnumSet.of(TaskType.VALIDATE), (String) null)
: ProcessorFactory.fromValues(ValidatorFactory.createConfig(PDFAFlavour.NO_FLAVOUR,
PDFAFlavour.NO_FLAVOUR, true, 0, false, isLogsEnabled, Level.WARNING,
BaseValidator.DEFAULT_MAX_NUMBER_OF_DISPLAYED_FAILED_CHECKS, false, "", false, false),
BaseValidator.DEFAULT_MAX_NUMBER_OF_DISPLAYED_FAILED_CHECKS, true, "", false, false),
null, null, fixConf, EnumSet.of(TaskType.VALIDATE), this.customProfile, null);

BatchProcessor processor = ProcessorFactory.fileBatchProcessor(processorConfig);
Expand Down Expand Up @@ -199,6 +199,9 @@ public void generate(boolean isTagged) {
if (nodeList.getLength() == 0) {
generateExceptionPolicy();
} else {
if (nodeList.getLength() > 1) {
LOGGER.log(Level.WARNING, "The validation report contains results for several profiles. Policy file is probably incorrect.");
}
String profileName = nodeList.item(0).getAttributes().getNamedItem("profileName").getNodeValue();
String isCompliant = nodeList.item(0).getAttributes().getNamedItem("isCompliant").getNodeValue();
if ("true".equals(isCompliant)) {
Expand Down Expand Up @@ -381,7 +384,7 @@ private void appendLogs() {

private static String getSchString(String string) {
if (string.contains("\"")) {
logger.log(Level.WARNING, "Log or error message contains double quote");
LOGGER.log(Level.WARNING, "Log or error message contains double quote");
}
return string.replace("&", "&amp;")
.replace("<", "&lt;")
Expand Down