public static void main(String[] args) { XACMLRepair xacmlRepair = new XACMLRepair(); try { if (xacmlRepair.init(args)) { xacmlRepair.run(); } } catch (Exception ex) { System.err.println("Exception: " + ex.getMessage()); ex.printStackTrace(System.err); System.exit(1);; } System.exit(0); }
this.getDOMDocumentRepair(); return true;
this.getDOMDocumentRepair(); return true;
public static void main(String[] args) { XACMLRepair xacmlRepair = new XACMLRepair(); try { if (xacmlRepair.init(args)) { xacmlRepair.run(); } } catch (Exception ex) { System.err.println("Exception: " + ex.getMessage()); ex.printStackTrace(System.err); System.exit(1);; } System.exit(0); }
private void run(File inputFile) throws Exception { String msg; if (!inputFile.exists()) { System.err.println((msg = "Input file " + inputFile.getAbsolutePath() + " does not exist.")); logger.error(msg); return; } else if (inputFile.isDirectory()) { File[] directoryContents = inputFile.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".xml"); } }); if (directoryContents != null && directoryContents.length > 0) { for (File file: directoryContents) { this.run(file); } } } else { try (FileInputStream fileInputStream = new FileInputStream(inputFile)) { this.run(fileInputStream, inputFile); } } }
DOMDocumentRepair domDocumentRepair = this.getDOMDocumentRepair(); try { bUpdated = domDocumentRepair.repair(documentFile);
private void run(InputStream inputStream, File fileOrig) throws Exception { if (this.outputFileOrDirectory == null) { this.run(inputStream, fileOrig, System.out, null); } else if (this.outputFileOrDirectory.exists()) { if (this.outputFileOrDirectory.isDirectory()) { boolean bWritten = false; try (FileOutputStream fileOutputStream = new FileOutputStream(fileOutput) ) { bWritten = this.run(inputStream, fileOrig, fileOutputStream, fileOutput); try { fileOutputStream = new FileOutputStream(this.outputFileOrDirectory); bWritten = this.run(inputStream, fileOrig, fileOutputStream, this.outputFileOrDirectory); } finally { if (fileOutputStream != null) {
DOMDocumentRepair domDocumentRepair = this.getDOMDocumentRepair(); try { bUpdated = domDocumentRepair.repair(documentFile);
private void run(File inputFile) throws Exception { String msg; if (!inputFile.exists()) { System.err.println((msg = "Input file " + inputFile.getAbsolutePath() + " does not exist.")); logger.error(msg); return; } else if (inputFile.isDirectory()) { File[] directoryContents = inputFile.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".xml"); } }); if (directoryContents != null && directoryContents.length > 0) { for (File file: directoryContents) { this.run(file); } } } else { try (FileInputStream fileInputStream = new FileInputStream(inputFile)) { this.run(fileInputStream, inputFile); } } }
private void run(InputStream inputStream, File fileOrig) throws Exception { if (this.outputFileOrDirectory == null) { this.run(inputStream, fileOrig, System.out, null); } else if (this.outputFileOrDirectory.exists()) { if (this.outputFileOrDirectory.isDirectory()) { boolean bWritten = false; try (FileOutputStream fileOutputStream = new FileOutputStream(fileOutput) ) { bWritten = this.run(inputStream, fileOrig, fileOutputStream, fileOutput); try { fileOutputStream = new FileOutputStream(this.outputFileOrDirectory); bWritten = this.run(inputStream, fileOrig, fileOutputStream, this.outputFileOrDirectory); } finally { if (fileOutputStream != null) {