use of org.opensextant.ConfigException in project Xponents by OpenSextant.
the class OutlookPSTCrawler method collect.
@Override
public void collect() throws IOException, ConfigException {
//
// Logic: Traverse PST file.
// it contains mail, contacts, tasks, notes, other stuff?
//
// Replicate folder structure discovered.
// Mail and date-oriented items should be filed by date. For now, YYYY-MM-DD is fine.
//
// For mail messages, review DefaultMailCralwer:
// - for each message
// save message to disk; create parent folder to contain message contents
// run text conversion individually on attachments.
//
// - structure:
// ./Mail/
// 2014-04-09/messageABC.eml
// 2014-04-09/messageABC/attachment1.doc
log.info("Traversing PST Folders for FILE={}", pst);
try {
PSTFile pstStore = new PSTFile(pst);
processFolder(pstStore.getRootFolder());
} catch (PSTException err) {
throw new ConfigException("Failure with PST traversal", err);
}
}
use of org.opensextant.ConfigException in project Xponents by OpenSextant.
the class ImageGroper method main.
public static void main(String[] args) {
gnu.getopt.Getopt opts = new gnu.getopt.Getopt("ImageGroper", args, "hei:o:");
String input = null;
String output = null;
boolean embed = false;
try {
int c;
while ((c = opts.getopt()) != -1) {
switch(c) {
case 'i':
input = opts.getOptarg();
break;
case 'o':
output = opts.getOptarg();
break;
case 'e':
embed = true;
System.out.println("Saving conversions to Input folder. Output folder will be ignored.");
break;
default:
ImageGroper.usage();
System.exit(1);
}
}
} catch (Exception err) {
ImageGroper.usage();
System.exit(1);
}
// Setting LANG=en_US in your shell.
//
// System.setProperty("LANG", "en_US");
XText xt = new XText();
xt.enableSaving(true);
// creates a ./text/ Folder locally in directory.
xt.getPathManager().enableSaveWithInput(embed);
xt.clearSettings();
xt.convertFileType("jpg");
xt.convertFileType("jpeg");
try {
xt.getPathManager().setConversionCache(output);
xt.setup();
xt.extractText(input);
} catch (IOException ioerr) {
ioerr.printStackTrace();
} catch (ConfigException cfgerr) {
cfgerr.printStackTrace();
}
}
use of org.opensextant.ConfigException in project Xponents by OpenSextant.
the class MailClientTest method main.
/**
* Simple connection demo. No mail reading... just configure, connect, disconnect.
* @param args
*/
public static void main(String[] args) {
try {
System.out.println("Usage: MailClientTest cfg-url /save/to/archive");
MailConfig imapClientCfg;
URL abc = MailClient.class.getResource(args[0]);
imapClientCfg = new MailConfig(abc);
MailClient imapClient = new MailClient(imapClientCfg, args[1]);
imapClient.connect();
imapClient.disconnect();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ConfigException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Aggregations