コード例 #1
0
ファイル: Exporter.java プロジェクト: jameswu/code-search
  public static void exportWithProperties(String propFile, String outFile) throws IOException {
    Properties props = new Properties();
    try {
      props.load(new FileInputStream(propFile));
    } catch (FileNotFoundException e) {
      System.err.println("Property file not found: " + propFile);
      System.exit(2);
    } catch (IOException e) {
      System.err.println("Unable to read properties: " + propFile);
      System.exit(2);
    }

    OutputStream out = null;

    try {
      out = new BufferedOutputStream(new FileOutputStream(outFile));
      WikiEngine engine = new WikiEngine(props);

      Exporter x = new Exporter(out, true);

      x.export(engine);
    } catch (WikiException e) {
      // TODO Auto-generated catch block
      e.printStackTrace(System.err);
      System.exit(3);
    } catch (IOException e) {
      e.printStackTrace(System.err);
      System.exit(3);
    } finally {
      if (out != null) out.close();

      // Make sure JSPWiki dies too
      System.exit(0);
    }
  }
コード例 #2
0
ファイル: Exporter.java プロジェクト: jameswu/code-search
  /**
   * This is a special version of the routine which knows the FileSystemProvider default format.
   *
   * @param dir
   * @param outFile
   * @throws IOException
   */
  public static void exportWithDir(String dir, String outFile) throws IOException {
    FileOutputStream out = new FileOutputStream(new File(outFile));
    Exporter x = new Exporter(out, true);

    x.export(dir);

    out.close();
  }
コード例 #3
0
ファイル: ClientController.java プロジェクト: piopawlu/ols
 /**
  * Exports the current diagram to the given exporter.
  *
  * @param aExporter the exporter to export to, cannot be <code>null</code>.
  * @param aOutputStream the output stream to write the export to, cannot be <code>null</code>.
  * @throws IOException in case of I/O problems.
  */
 public void exportTo(final Exporter aExporter, final OutputStream aOutputStream)
     throws IOException {
   if (this.mainFrame != null) {
     aExporter.export(this.dataContainer, this.mainFrame.getDiagramScrollPane(), aOutputStream);
   }
 }