use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.
the class YamlInputMeta method check.
@Override
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
// See if we get input...
if (input.length <= 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoInputExpected"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoInput"), stepMeta);
remarks.add(cr);
}
if (getInputFields().length <= 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoInputField"), stepMeta);
remarks.add(cr);
}
if (isInFields()) {
if (Utils.isEmpty(getYamlField())) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoField"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.FieldOk"), stepMeta);
remarks.add(cr);
}
} else {
FileInputList fileInputList = getFiles(transMeta);
// String files[] = getFiles();
if (fileInputList == null || fileInputList.getFiles().size() == 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoFiles"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.FilesOk", "" + fileInputList.getFiles().size()), stepMeta);
remarks.add(cr);
}
}
}
use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.
the class PropertyInputMeta method check.
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
// See if we get input...
if (input.length > 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "PropertyInputMeta.CheckResult.NoInputExpected"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "PropertyInputMeta.CheckResult.NoInput"), stepMeta);
remarks.add(cr);
}
FileInputList fileInputList = getFiles(transMeta);
if (fileInputList == null || fileInputList.getFiles().size() == 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "PropertyInputMeta.CheckResult.NoFiles"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "PropertyInputMeta.CheckResult.FilesOk", "" + fileInputList.getFiles().size()), stepMeta);
remarks.add(cr);
}
}
use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.
the class LDIFInputMeta method check.
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
// See if we get input...
if (input.length > 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LDIFInputMeta.CheckResult.NoInputExpected"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LDIFInputMeta.CheckResult.NoInput"), stepMeta);
remarks.add(cr);
}
FileInputList fileInputList = getFiles(transMeta);
if (fileInputList == null || fileInputList.getFiles().size() == 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LDIFInputMeta.CheckResult.NoFiles"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LDIFInputMeta.CheckResult.FilesOk", "" + fileInputList.getFiles().size()), stepMeta);
remarks.add(cr);
}
}
use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.
the class LoadFileInputMeta method check.
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
if (getIsInFields()) {
// See if we get input...
if (input.length == 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.NoInputExpected"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.NoInput"), stepMeta);
remarks.add(cr);
}
if (Utils.isEmpty(getDynamicFilenameField())) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.NoField"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.FieldOk"), stepMeta);
remarks.add(cr);
}
} else {
FileInputList fileInputList = getFiles(transMeta);
if (fileInputList == null || fileInputList.getFiles().size() == 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.NoFiles"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.FilesOk", "" + fileInputList.getFiles().size()), stepMeta);
remarks.add(cr);
}
}
}
use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.
the class GetFileNamesMeta method check.
@Override
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
// See if we get input...
if (filefield) {
if (input.length > 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.InputOk"), stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.InputErrorKo"), stepMeta);
}
remarks.add(cr);
if (Utils.isEmpty(dynamicFilenameField)) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.FolderFieldnameMissing"), stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.FolderFieldnameOk"), stepMeta);
}
remarks.add(cr);
} else {
if (input.length > 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.NoInputError"), stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.NoInputOk"), stepMeta);
}
remarks.add(cr);
// check specified file names
FileInputList fileList = getFileList(transMeta);
if (fileList.nrOfFiles() == 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.ExpectedFilesError"), stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.ExpectedFilesOk", "" + fileList.nrOfFiles()), stepMeta);
}
remarks.add(cr);
}
}
Aggregations