Exemplo n.º 1
0
  public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
    meta = (LoadFileInputMeta) smi;
    data = (LoadFileInputData) sdi;

    if (super.init(smi, sdi)) {
      if (!meta.getIsInFields()) {
        try {
          data.files = meta.getFiles(this);
          handleMissingFiles();
          // Create the output row meta-data
          data.outputRowMeta = new RowMeta();
          meta.getFields(
              data.outputRowMeta, getStepname(), null, null, this); // get the metadata populated

          // Create convert meta-data objects that will contain Date & Number formatters
          //
          data.convertRowMeta = data.outputRowMeta.cloneToType(ValueMetaInterface.TYPE_STRING);
        } catch (Exception e) {
          logError("Error at step initialization: " + e.toString());
          logError(Const.getStackTracker(e));
          return false;
        }
      }
      data.rownr = 1L;
      data.nrInputFields = meta.getInputFields().length;

      return true;
    }
    return false;
  }