To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 479fb58d authored by john's avatar john
Browse files

added small tool for helping process docs, added some blank docs and alterred...

added small tool for helping process docs, added some blank docs and alterred build to construct documentation
parent c686de9c
/*
* Copyright (c) 2009 The Australian National University.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0.
* You may obtain the license at
*
* http://www.opensource.org/licenses/apache2.0.php
*
* Simple transformer tool to apply an xslt to an xml file to yield a
* transformed result.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import javax.xml.transform.*;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import org.xml.sax.InputSource;
public class Makedoc {
/**
* @param args
* @throws FileNotFoundException
* @throws TransformerException
*/
public static void main(String[] args) throws TransformerException {
if (args.length < 2 || 3 < args.length) {
reportUsage();
System.exit(1);
}
try {
File xsltFile = new File(args[0]);
File xmlFile = new File(args[1]);
OutputStream os = System.out;
if (args.length == 3) {
File outFile = new File(args[2]);
os = new FileOutputStream(outFile);
}
TransformerFactory factory = TransformerFactory.newInstance();
SAXSource xsltSource = new SAXSource(new InputSource(new FileInputStream(xsltFile)));
SAXSource xmlSource = new SAXSource(new InputSource(new FileInputStream(xmlFile)));
Transformer transformer = factory.newTransformer(xsltSource);
StreamResult outputTarget = new StreamResult(os);
transformer.transform(xmlSource, outputTarget);
} catch (FileNotFoundException fnfe) {
reportUsage();
System.exit(10);
}
}
private static void reportUsage() {
System.err.println("usage:");
System.err.println(" java " + Makedoc.class.toString() + " <xslt> <xml> [<output>]");
System.err.println(" <xslt> the input xlst file that used to transform the xml file.");
System.err.println(" <xml> the input xml file that is transformed according to the xslt file.");
System.err.println(" [<output>] the file the transformed xml is written to (if unspecified then");
System.err.println(" the output is written to stdout).");
}
}
/*
* Copyright (c) 2009 The Australian National University.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0.
* You may obtain the license at
*
* http://www.opensource.org/licenses/apache2.0.php
*
* Simple transformer tool to apply an xslt to an xml file to yield a
* transformed result.
*/
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
public final class UpdateMenu {
private static final String MENU_COMMENT_LINE = "<!-- ADD BENCHMARK HERE -->";
private static final String MENU_URL_LINE = "<LI><A HREF=\"%s/%s.html\" TARGET=\"MAIN\">%s</A></LI>";
/**
* @param args
*/
public static void main(String[] args) throws IOException {
if (args.length < 2 || 3 < args.length) {
reportUsage();
System.exit(1);
}
try {
File inputFile = new File(args[0]);
FileInputStream is = new FileInputStream(inputFile);
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String benchmark = args[1];
PrintStream os = System.out;
if (args.length == 3) {
os = new PrintStream(new File(args[2]));
}
String line = null;
while ((line = reader.readLine()) != null) {
if (line.equals(MENU_COMMENT_LINE)) {
os.printf(MENU_URL_LINE, benchmark,benchmark,benchmark);
os.println();
}
os.println(line);
}
os.close();
reader.close();
} catch (FileNotFoundException e) {
reportUsage();
}
}
private static void reportUsage() {
System.err.println("usage:");
System.err.println(" java " + UpdateMenu.class.toString() + " <input> <bm> [<output>]");
System.err.println(" <in> the input file that the bm will be added to.");
System.err.println(" <bm> the name of the bm to add.");
System.err.println(" [<output>] the file the transformed xml is written to (if unspecified then");
System.err.println(" the output is written to stdout).");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment