当前位置: 首页>>代码示例>>Java>>正文


Java ResultFile类代码示例

本文整理汇总了Java中org.pentaho.di.core.ResultFile的典型用法代码示例。如果您正苦于以下问题:Java ResultFile类的具体用法?Java ResultFile怎么用?Java ResultFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResultFile类属于org.pentaho.di.core包,在下文中一共展示了ResultFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addFileToResultFilenames

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,LogWriter log,Result result,Job parentJob)
	{	
		try
		{
			ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry), parentJob.getJobname(), toString());
			result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
	    
			if(log.isDebug())
			{
				log.logDebug(toString()," ------ ");
				log.logDebug(toString(),Messages.getString("JobMoveFiles.Log.FileAddedToResultFilesName",fileaddentry));
			}
			
		}catch (Exception e)
		{
			log.logError(Messages.getString("JobMoveFiles.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
		}

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:JobEntryMoveFiles.java

示例2: addFileToResultFilenames

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,LogWriter log,Result result,Job parentJob)
	{	
		try
		{
			ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry), parentJob.getName(), toString());
			result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
	    
			if(log.isDetailed())
			{
				log.logDetailed(toString(),Messages.getString("JobXMLWellFormed.Log.FileAddedToResultFilesName",fileaddentry));
			}
			
		}catch (Exception e)
		{
			log.logError(toString(),Messages.getString("JobXMLWellFormed.Error.AddingToFilenameResult",fileaddentry,e.getMessage()));
		}

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:JobEntryXMLWellFormed.java

示例3: processRow

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
	if (data.resultFilesList == null || getLinesRead() >= data.resultFilesList.size())
	{
		setOutputDone();
		return false;
	}

	ResultFile resultFile = (ResultFile) data.resultFilesList.get((int) getLinesRead());
	RowMetaAndData r = resultFile.getRow();
	
	data.outputRowMeta = r.getRowMeta();
	
	smi.getFields(data.outputRowMeta, getStepname(), null, null, this);
	incrementLinesRead();

	putRow(data.outputRowMeta, r.getData()); // copy row to possible alternate
									// rowset(s).

	if (checkFeedback(getLinesRead()))
		logBasic(Messages.getString("FilesFromResult.Log.LineNumber") + getLinesRead()); //$NON-NLS-1$

	return true;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:25,代码来源:FilesFromResult.java

示例4: getFields

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{

	// Add the fields from a ResultFile
       try
       {
   		ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject("foo.bar"), "parentOrigin", "origin");
   		RowMetaAndData add = resultFile.getRow();

           // Set the origin on the fields...
           for (int i=0;i<add.size();i++) add.getValueMeta(i).setOrigin(name);
           r.addRowMeta(add.getRowMeta());
       }
       catch(IOException e)
       {
           throw new KettleStepException(e);
       }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:FilesFromResultMeta.java

示例5: PrepareFile

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void PrepareFile() throws IOException
  {
String filename=environmentSubstitute(meta.getFilename());
   if(meta.isAddToResultFiles())
      {
	// Add this to the result file names...
	ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(filename), getTransMeta().getName(), getStepname());
	resultFile.setComment("This file was created with a cube file output step");
          addResultFile(resultFile);
      }

   
data.fos=KettleVFS.getOutputStream(filename, false);
data.zip=new GZIPOutputStream(data.fos);
data.dos=new DataOutputStream(data.zip);
  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:CubeOutput.java

示例6: ok

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void ok()
{
	if (Const.isEmpty(wStepname.getText())) return;

	stepname = wStepname.getText(); // return value
	
	input.setFilenameField(wFilenameField.getText());
	if (wTypes.getSelectionIndex()>=0) 
	{
		input.setFileType( wTypes.getSelectionIndex() );
	}
	else
	{
		input.setFileType( ResultFile.FILE_TYPE_GENERAL );
	}
	
	dispose();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:FilesToResultDialog.java

示例7: addFileToResultFilenames

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,Result result,Job parentJob)
	{	
		try
		{
			ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry, this), parentJob.getJobname(), toString());
			result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
	    
			if(log.isDebug())
			{
				logDebug(" ------ ");
				logDebug(BaseMessages.getString(PKG, "JobMoveFiles.Log.FileAddedToResultFilesName",fileaddentry));
			}
			
		}catch (Exception e)
		{
			log.logError(BaseMessages.getString(PKG, "JobMoveFiles.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
		}

}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:20,代码来源:JobEntryMoveFiles.java

示例8: addFileToResultFilenames

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,Result result,Job parentJob)
	{	
		try
		{
			ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry, this), parentJob.getName(), toString());
			result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
	    
			if(log.isDetailed())
			{
				logDetailed(BaseMessages.getString(PKG, "JobXMLWellFormed.Log.FileAddedToResultFilesName",fileaddentry));
			}
			
		}catch (Exception e)
		{
			logError(BaseMessages.getString(PKG, "JobXMLWellFormed.Error.AddingToFilenameResult",fileaddentry,e.getMessage()));
		}

}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:JobEntryXMLWellFormed.java

示例9: processRow

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
	if (data.resultFilesList == null || getLinesRead() >= data.resultFilesList.size())
	{
		setOutputDone();
		return false;
	}

	ResultFile resultFile = (ResultFile) data.resultFilesList.get((int) getLinesRead());
	RowMetaAndData r = resultFile.getRow();

	if (first) {
		first=false;
		data.outputRowMeta = new RowMeta();
		smi.getFields(data.outputRowMeta, getStepname(), null, null, this);
	}
	incrementLinesRead();

	putRow(data.outputRowMeta, r.getData()); // copy row to possible alternate
									// rowset(s).

	if (checkFeedback(getLinesRead()))
		logBasic(BaseMessages.getString(PKG, "FilesFromResult.Log.LineNumber") + getLinesRead()); //$NON-NLS-1$

	return true;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:FilesFromResult.java

示例10: getFields

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{

	// Add the fields from a ResultFile
       try
       {
   		ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject("foo.bar", space), "parentOrigin", "origin");
   		RowMetaAndData add = resultFile.getRow();

           // Set the origin on the fields...
           for (int i=0;i<add.size();i++) add.getValueMeta(i).setOrigin(name);
           r.addRowMeta(add.getRowMeta());
       }
       catch(KettleFileException e)
       {
           throw new KettleStepException(e);
       }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:FilesFromResultMeta.java

示例11: prepareFile

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void prepareFile() throws KettleFileException
 {
 	try {
String filename=environmentSubstitute(meta.getFilename());
   if(meta.isAddToResultFiles())
      {
	// Add this to the result file names...
	ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(filename, getTransMeta()), getTransMeta().getName(), getStepname());
	resultFile.setComment("This file was created with a cube file output step");
          addResultFile(resultFile);
      }
	
   
data.fos=KettleVFS.getOutputStream(filename, getTransMeta(), false);
data.zip=new GZIPOutputStream(data.fos);
data.dos=new DataOutputStream(data.zip);
 	}
 	catch(Exception e) {
 		throw new KettleFileException(e);
 	}
 }
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:22,代码来源:CubeOutput.java

示例12: testCollectExecutionResultFilesDisabledHop

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
@Test
public void testCollectExecutionResultFilesDisabledHop() throws KettleException {
  Result result = mock( Result.class );
  ResultFile resultFile = mock( ResultFile.class, RETURNS_DEEP_STUBS );

  when( result.getResultFilesList() ).thenReturn( Arrays.asList( resultFile ) );

  StepMeta resultFilesTargetStepMeta = mock( StepMeta.class );
  meta.setResultFilesTargetStepMeta( resultFilesTargetStepMeta );

  RowMetaInterface resultFilesOutputRowMeta = mock( RowMetaInterface.class );
  data.setResultFilesOutputRowMeta( resultFilesOutputRowMeta );

  doNothing().when( executor ).putRowTo( any(), any(), any() );

  executor.init( meta, data );
  executor.collectExecutionResultFiles( result );

  verify( executor, never() ).putRowTo( any(), any(), any() );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:21,代码来源:TransExecutorUnitTest.java

示例13: ok

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
private void ok() {
  if ( Utils.isEmpty( wStepname.getText() ) ) {
    return;
  }

  stepname = wStepname.getText(); // return value

  input.setFilenameField( wFilenameField.getText() );
  if ( wTypes.getSelectionIndex() >= 0 ) {
    input.setFileType( wTypes.getSelectionIndex() );
  } else {
    input.setFileType( ResultFile.FILE_TYPE_GENERAL );
  }

  dispose();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:17,代码来源:FilesToResultDialog.java

示例14: testStepMeta

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
@Test
public void testStepMeta() throws KettleException {
  List<String> attributes = Arrays.asList( "filename_field", "file_type" );

  Map<String, String> getterMap = new HashMap<String, String>();
  getterMap.put( "filename_field", "getFilenameField" );
  getterMap.put( "file_type", "getFileType" );

  Map<String, String> setterMap = new HashMap<String, String>();
  setterMap.put( "filename_field", "setFilenameField" );
  setterMap.put( "file_type", "setFileType" );

  Map<String, FieldLoadSaveValidator<?>> fieldLoadSaveValidatorAttributeMap =
    new HashMap<String, FieldLoadSaveValidator<?>>();
  fieldLoadSaveValidatorAttributeMap.put( "file_type",
    new IntLoadSaveValidator( ResultFile.fileTypeCode.length ) );

  LoadSaveTester loadSaveTester =
    new LoadSaveTester( FilesToResultMeta.class, attributes, getterMap, setterMap,
      fieldLoadSaveValidatorAttributeMap, new HashMap<String, FieldLoadSaveValidator<?>>() );
  loadSaveTester.testSerialization();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:FilesToResultMetaTest.java

示例15: processRow

import org.pentaho.di.core.ResultFile; //导入依赖的package包/类
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
  if ( data.resultFilesList == null || getLinesRead() >= data.resultFilesList.size() ) {
    setOutputDone();
    return false;
  }

  ResultFile resultFile = data.resultFilesList.get( (int) getLinesRead() );
  RowMetaAndData r = resultFile.getRow();

  if ( first ) {
    first = false;
    data.outputRowMeta = new RowMeta();
    smi.getFields( data.outputRowMeta, getStepname(), null, null, this, repository, metaStore );
  }
  incrementLinesRead();

  putRow( data.outputRowMeta, r.getData() ); // copy row to possible alternate
  // rowset(s).

  if ( checkFeedback( getLinesRead() ) ) {
    logBasic( BaseMessages.getString( PKG, "FilesFromResult.Log.LineNumber" ) + getLinesRead() );
  }

  return true;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:FilesFromResult.java


注:本文中的org.pentaho.di.core.ResultFile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。