Search in sources :

Example 56 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class JobEntrySSH2PUT method getResourceDependencies.

@Override
public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    if (!Utils.isEmpty(serverName)) {
        String realServerName = jobMeta.environmentSubstitute(serverName);
        ResourceReference reference = new ResourceReference(this);
        reference.getEntries().add(new ResourceEntry(realServerName, ResourceType.SERVER));
        references.add(reference);
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Example 57 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class XMLInputMeta method getResourceDependencies.

@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
    List<ResourceReference> references = new ArrayList<ResourceReference>(5);
    ResourceReference reference = new ResourceReference(stepInfo);
    references.add(reference);
    // 
    // Get the file path list from the FileInputList
    // 
    String[] required = new String[fileName.length];
    // boolean arrays are defaulted to false.
    boolean[] subdirs = new boolean[fileName.length];
    for (int i = 0; i < required.length; i++) {
        required[i] = "N";
    }
    String[] textFiles = FileInputList.createFilePathList(transMeta, fileName, fileMask, new String[] { null }, required, subdirs);
    if (textFiles != null) {
        for (int i = 0; i < textFiles.length; i++) {
            reference.getEntries().add(new ResourceEntry(textFiles[i], ResourceType.FILE));
        }
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ArrayList(java.util.ArrayList) ResourceReference(org.pentaho.di.resource.ResourceReference)

Example 58 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class JobEntryDTDValidator method getResourceDependencies.

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    if ((!Utils.isEmpty(dtdfilename)) && (!Utils.isEmpty(xmlfilename))) {
        String realXmlFileName = jobMeta.environmentSubstitute(xmlfilename);
        String realXsdFileName = jobMeta.environmentSubstitute(dtdfilename);
        ResourceReference reference = new ResourceReference(this);
        reference.getEntries().add(new ResourceEntry(realXmlFileName, ResourceType.FILE));
        reference.getEntries().add(new ResourceEntry(realXsdFileName, ResourceType.FILE));
        references.add(reference);
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Example 59 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class JobEntryXSDValidator method getResourceDependencies.

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    if ((!Utils.isEmpty(xsdfilename)) && (!Utils.isEmpty(xmlfilename))) {
        String realXmlFileName = jobMeta.environmentSubstitute(xmlfilename);
        String realXsdFileName = jobMeta.environmentSubstitute(xsdfilename);
        ResourceReference reference = new ResourceReference(this);
        reference.getEntries().add(new ResourceEntry(realXmlFileName, ResourceType.FILE));
        reference.getEntries().add(new ResourceEntry(realXsdFileName, ResourceType.FILE));
        references.add(reference);
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Example 60 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class JobEntryXSLT method getResourceDependencies.

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    if ((!Utils.isEmpty(xslfilename)) && (!Utils.isEmpty(xmlfilename))) {
        String realXmlFileName = jobMeta.environmentSubstitute(xmlfilename);
        String realXslFileName = jobMeta.environmentSubstitute(xslfilename);
        ResourceReference reference = new ResourceReference(this);
        reference.getEntries().add(new ResourceEntry(realXmlFileName, ResourceType.FILE));
        reference.getEntries().add(new ResourceEntry(realXslFileName, ResourceType.FILE));
        references.add(reference);
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Aggregations

ResourceEntry (org.pentaho.di.resource.ResourceEntry)63 ResourceReference (org.pentaho.di.resource.ResourceReference)61 ArrayList (java.util.ArrayList)17 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)4 JobMeta (org.pentaho.di.job.JobMeta)4 Test (org.junit.Test)3 ResultFile (org.pentaho.di.core.ResultFile)2 Job (org.pentaho.di.job.Job)2 IExecutionData (org.pentaho.metaverse.api.model.IExecutionData)2 IExecutionProfile (org.pentaho.metaverse.api.model.IExecutionProfile)2 Throwables (com.google.common.base.Throwables)1 File (java.io.File)1 Serializable (java.io.Serializable)1 Path (java.nio.file.Path)1 Paths (java.nio.file.Paths)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Consumer (java.util.function.Consumer)1 Predicate (java.util.function.Predicate)1