Search in sources :

Example 1 with OutlookPSTCrawler

use of org.opensextant.xtext.collectors.mailbox.OutlookPSTCrawler in project Xponents by OpenSextant.

the class XText method convertOutlookPST.

/**
     *
     * @param input
     *            input PST object
     * @throws IOException
     *             on err
     * @throws ConfigException
     *             on err
     */
public void convertOutlookPST(File input) throws ConfigException, IOException {
    if (!paths.isSaving()) {
        log.error("Warning -- PST file found, but save = true is required to parse it.  Enable saving and chose a cache folder");
    }
    OutlookPSTCrawler pst = new OutlookPSTCrawler(input);
    pst.setConverter(this);
    pst.overwriteMode = ConvertedDocument.overwrite;
    pst.incrementalMode = true;
    File saveFolder = paths.getArchiveExportDir(input);
    String savePrefix = paths.getStipPrefixPath();
    paths.setStripPrefixPath(saveFolder.getAbsolutePath());
    paths.setInputRoot(saveFolder);
    pst.setOutputPSTDir(saveFolder);
    pst.configure();
    log.info("\tPST Email Archive Found ({}). Expanding to {}", input, saveFolder);
    try {
        pst.collect();
    } catch (Exception err) {
        throw new ConfigException("Unable to fully digest PST file " + input, err);
    }
    // Done:
    paths.setStripPrefixPath(savePrefix);
}
Also used : ConfigException(org.opensextant.ConfigException) File(java.io.File) ConfigException(org.opensextant.ConfigException) IOException(java.io.IOException) MimeTypeParseException(javax.activation.MimeTypeParseException) OutlookPSTCrawler(org.opensextant.xtext.collectors.mailbox.OutlookPSTCrawler)

Example 2 with OutlookPSTCrawler

use of org.opensextant.xtext.collectors.mailbox.OutlookPSTCrawler in project Xponents by OpenSextant.

the class TestPST method main.

public static void main(String[] args) {
    try {
        OutlookPSTCrawler pst = new OutlookPSTCrawler(args[0]);
        pst.incrementalMode = true;
        pst.overwriteMode = true;
        pst.setOutputDir(new File("/tmp"));
        pst.configure();
        pst.collect();
    } catch (Exception err) {
        err.printStackTrace();
    }
}
Also used : File(java.io.File) OutlookPSTCrawler(org.opensextant.xtext.collectors.mailbox.OutlookPSTCrawler)

Aggregations

File (java.io.File)2 OutlookPSTCrawler (org.opensextant.xtext.collectors.mailbox.OutlookPSTCrawler)2 IOException (java.io.IOException)1 MimeTypeParseException (javax.activation.MimeTypeParseException)1 ConfigException (org.opensextant.ConfigException)1