use of org.opensextant.xtext.XText in project Xponents by OpenSextant.
the class SharepointCrawlTest method main.
public static void main(String[] args) {
gnu.getopt.Getopt opts = new gnu.getopt.Getopt("SharePointClient", args, "o:u:p:d:l:");
String spSite = null;
String u = null;
String p = null;
String d = null;
String o = null;
try {
int c;
while ((c = opts.getopt()) != -1) {
switch(c) {
case 'u':
u = opts.getOptarg();
break;
case 'p':
p = opts.getOptarg();
break;
case 'd':
d = opts.getOptarg();
break;
case 'l':
spSite = opts.getOptarg();
break;
case 'o':
o = opts.getOptarg();
break;
default:
usage();
System.exit(-1);
}
}
} catch (Exception execErr) {
usage();
execErr.printStackTrace();
System.exit(-1);
}
SharepointCrawlTest me = new SharepointCrawlTest();
try {
FileUtility.makeDirectory(o);
XText conv = new XText();
conv.enableSaving(true);
conv.getPathManager().setInputRoot(new File(o));
//conv.getPathManager().setExtractedChildrenCache(o);
conv.getPathManager().enableSaveWithInput(true);
//conv.getPathManager().setConversionCache(o+File.separator + "xtext");
conv.setup();
DefaultSharepointCrawl sp = new DefaultSharepointCrawl(spSite, o, u, p, d);
sp.configure();
// Set these items
sp.setConverter(conv);
sp.setListener(me);
// Go do it.
sp.collect();
} catch (Exception err) {
err.printStackTrace();
}
}
Aggregations