Ejemplo n.º 1
0
 public FileInputList getDynamicFolderList(
     VariableSpace space, String[] folderName, String[] folderRequired) {
   return FileInputList.createFolderList(space, folderName, folderRequired);
 }
Ejemplo n.º 2
0
  public void check(
      List<CheckResultInterface> remarks,
      TransMeta transMeta,
      StepMeta stepinfo,
      RowMetaInterface prev,
      String input[],
      String output[],
      RowMetaInterface info) {
    CheckResult cr;

    // See if we get input...
    if (isFoldernameDynamic) {
      if (input.length > 0)
        cr =
            new CheckResult(
                CheckResultInterface.TYPE_RESULT_OK,
                Messages.getString("GetSubFoldersMeta.CheckResult.InputOk"),
                stepinfo);
      else
        cr =
            new CheckResult(
                CheckResultInterface.TYPE_RESULT_ERROR,
                Messages.getString("GetSubFoldersMeta.CheckResult.InputErrorKo"),
                stepinfo);
      remarks.add(cr);

      if (Const.isEmpty(dynamicFoldernameField))
        cr =
            new CheckResult(
                CheckResultInterface.TYPE_RESULT_ERROR,
                Messages.getString("GetSubFoldersMeta.CheckResult.FolderFieldnameMissing"),
                stepinfo);
      else
        cr =
            new CheckResult(
                CheckResultInterface.TYPE_RESULT_OK,
                Messages.getString("GetSubFoldersMeta.CheckResult.FolderFieldnameOk"),
                stepinfo);

      remarks.add(cr);
    } else {
      if (input.length > 0)
        cr =
            new CheckResult(
                CheckResultInterface.TYPE_RESULT_ERROR,
                Messages.getString("GetSubFoldersMeta.CheckResult.NoInputError"),
                stepinfo);
      else
        cr =
            new CheckResult(
                CheckResultInterface.TYPE_RESULT_OK,
                Messages.getString("GetSubFoldersMeta.CheckResult.NoInputOk"),
                stepinfo);
      remarks.add(cr);
      // check specified folder names
      FileInputList fileList = getFolderList(transMeta);
      if (fileList.nrOfFiles() == 0) {
        cr =
            new CheckResult(
                CheckResultInterface.TYPE_RESULT_ERROR,
                Messages.getString("GetSubFoldersMeta.CheckResult.ExpectedFoldersError"),
                stepinfo);
        remarks.add(cr);
      } else {
        cr =
            new CheckResult(
                CheckResultInterface.TYPE_RESULT_OK,
                Messages.getString(
                    "GetSubFoldersMeta.CheckResult.ExpectedFilesOk", "" + fileList.nrOfFiles()),
                stepinfo);
        remarks.add(cr);
      }
    }
  }
Ejemplo n.º 3
0
 public FileInputList getFolderList(VariableSpace space) {
   return FileInputList.createFolderList(space, folderName, folderRequired);
 }