Esempio n. 1
0
  /**
   * Builds the output event, with information about the imported data.
   *
   * @param outputEvents
   * @param schema
   * @return
   * @throws FileNotFoundException
   * @throws ActionException
   */
  protected EventObject buildOutputEvent() throws FileNotFoundException, ActionException {
    updateTask("Building output event");
    FileOutputStream outStream = null;
    try {
      File outputDir = getTempDir();
      File outputFile = new File(outputDir.getAbsolutePath() + File.separator + "output.xml");

      //                    new File(outputDir, "output.xml");
      outStream = new FileOutputStream(outputFile);
      configuration.getOutputFeature().toXML(outStream);
      updateTask("Output event built");
      return new FileSystemEvent(outputFile, FileSystemEventType.FILE_ADDED);
    } catch (Exception e) {
      throw new ActionException(this, "Error writing output event");
    } finally {
      IOUtils.closeQuietly(outStream);
    }
  }
Esempio n. 2
0
 /**
  * Creates the destination DataStore, from the configuration connection parameters.
  *
  * @return
  * @throws IOException
  * @throws ActionException
  */
 protected DataStore createOutputDataStore() throws IOException, ActionException {
   updateTask("Connecting to output DataStore");
   return createDataStore(configuration.getOutputFeature().getDataStore());
 }