Search in sources :

Example 6 with KettleTransException

use of org.pentaho.di.core.exception.KettleTransException in project pentaho-kettle by pentaho.

the class RepositoryBrowserController method isFileOpenedInFolder.

private void isFileOpenedInFolder(String path) throws KettleException {
    List<TransMeta> openedTransFiles = getSpoon().delegates.trans.getTransformationList();
    for (TransMeta t : openedTransFiles) {
        if (t.getRepositoryDirectory().getPath() != null && (t.getRepositoryDirectory().getPath() + "/").startsWith(path + "/")) {
            throw new KettleTransException();
        }
    }
    List<JobMeta> openedJobFiles = getSpoon().delegates.jobs.getJobList();
    for (JobMeta j : openedJobFiles) {
        if (j.getRepositoryDirectory().getPath() != null && (j.getRepositoryDirectory().getPath() + "/").startsWith(path + "/")) {
            throw new KettleJobException();
        }
    }
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) TransMeta(org.pentaho.di.trans.TransMeta) KettleTransException(org.pentaho.di.core.exception.KettleTransException) KettleJobException(org.pentaho.di.core.exception.KettleJobException)

Aggregations

KettleTransException (org.pentaho.di.core.exception.KettleTransException)6 KettleException (org.pentaho.di.core.exception.KettleException)3 KettleJobException (org.pentaho.di.core.exception.KettleJobException)3 KettleObjectExistsException (org.pentaho.di.core.exception.KettleObjectExistsException)2 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)2 TransLogTable (org.pentaho.di.core.logging.TransLogTable)2 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)2 RepositoryDirectoryInterface (org.pentaho.di.repository.RepositoryDirectoryInterface)2 RepositoryExtended (org.pentaho.di.repository.RepositoryExtended)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 Timer (java.util.Timer)1 TimerTask (java.util.TimerTask)1 FileObject (org.apache.commons.vfs2.FileObject)1 Before (org.junit.Before)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)1