if (args.length!=2) {
System.err.println("ERROR: invalid number of arguments: " + args.length);
System.exit(ExitCodes.ERROR_INVALID_NUMBER_OF_ARGUMENTS);
}
JXL jxl = new JXL();
File file = new File(args[0]);
System.out.println("Reading Plucker INI: " + file.getAbsolutePath());
IniFile ini = new IniFile(file);
Document[] documents = ini.getDocuments();
for (int i = 0; i < documents.length; i++) {
if (documents[i].getURL().startsWith("http://")) {
// Only imports HTTP URLs for now
Element site = jxl.createSiteElement();
documents[i].toJXLFormat(site);
jxl.add(site);
}
}
String s = args[1];
if (!s.endsWith(".jxl")) {
s+=".jxl";
}
File jxlFile = new File(s);
System.out.println("Writing JXL: " + jxlFile.getAbsolutePath());
jxl.save(jxlFile);
System.out.println("Done!");
}