use of org.pentaho.di.core.ObjectLocationSpecificationMethod in project pentaho-kettle by pentaho.
the class TransFileListener method processLinkedTrans.
protected TransMeta processLinkedTrans(TransMeta transMeta) {
for (StepMeta stepMeta : transMeta.getSteps()) {
if (stepMeta.getStepID().equalsIgnoreCase("TransExecutor")) {
TransExecutorMeta tem = (TransExecutorMeta) stepMeta.getStepMetaInterface();
ObjectLocationSpecificationMethod specMethod = tem.getSpecificationMethod();
// If the reference is by filename, change it to Repository By Name. Otherwise it's fine so leave it alone
if (specMethod == ObjectLocationSpecificationMethod.FILENAME) {
tem.setSpecificationMethod(ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME);
String filename = tem.getFileName();
String jobname = filename.substring(filename.lastIndexOf("/") + 1, filename.lastIndexOf('.'));
String directory = filename.substring(0, filename.lastIndexOf("/"));
tem.setTransName(jobname);
tem.setDirectoryPath(directory);
}
}
}
return transMeta;
}
Aggregations