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


Java ResourceDefinition类代码示例

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


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

示例1: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		// 

		// From : ${Internal.Transformation.Filename.Directory}/../foo/bar.txt
		// To   : /home/matt/test/files/foo/bar.txt
		//
		FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(filename));
		
		// If the file doesn't exist, forget about this effort too!
		//
		if (fileObject.exists()) {
			// Convert to an absolute path...
			// 
			filename = fileObject.getName().getPath();
			
			return filename;
		}
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:33,代码来源:FixedInputMeta.java

示例2: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		//
		// From : ${Internal.Transformation.Filename.Directory}/../foo/bar.data
		// To   : /home/matt/test/files/foo/bar.data
		//
		FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(fileName));
			
		// If the file doesn't exist, forget about this effort too!
		//
		if (fileObject.exists()) {
			// Convert to an absolute path...
			// 
			fileName = resourceNamingInterface.nameResource(fileObject.getName().getBaseName(), fileObject.getParent().getName().getPath(), space.toString(), FileNamingType.DATA_FILE);
			
			return fileName;
		}
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:SQLFileOutputMeta.java

示例3: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		//
		// From : ${Internal.Transformation.Filename.Directory}/../foo/bar.data
		// To   : /home/matt/test/files/foo/bar.data
		//
		FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(fileName));
			
		// If the file doesn't exist, forget about this effort too!
		//
		if (fileObject.exists()) {
			// Convert to an absolute path...
			// 
			fileName = resourceNamingInterface.nameResource(fileObject.getName().getBaseName(), fileObject.getParent().getName().getPath(), space.toString(), FileNamingType.DATA_FILE);
			return fileName;
		}
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:31,代码来源:PropertyOutputMeta.java

示例4: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of the base path into an absolute path.
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		// 
		if (!Const.isEmpty(fileName)) {
			FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(fileName));
			fileName = resourceNamingInterface.nameResource(fileObject.getName().getBaseName(), fileObject.getParent().getName().getPath(), space.toString(), FileNamingType.DATA_FILE);
		}
		
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:XMLOutputMeta.java

示例5: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		// In case the name of the file comes from previous steps, forget about this!
		//
		
		// From : ${Internal.Transformation.Filename.Directory}/../foo/bar.xsd
		// To   : /home/matt/test/files/foo/bar.xsd
		//
		if (!Const.isEmpty(xsdFilename)) {
			FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(xsdFilename));
			xsdFilename = resourceNamingInterface.nameResource(fileObject.getName().getBaseName(), fileObject.getParent().getName().getPath(), space.toString(), FileNamingType.DATA_FILE);
			
			return xsdFilename;
		}
	
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:30,代码来源:XsdValidatorMeta.java

示例6: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of the base path into an absolute path.
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		// In case the name of the file comes from previous steps, forget about this!
		// 
		if (!fileNameInField) {
			
			if (!Const.isEmpty(fileName)) {
				FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(fileName));
				fileName = resourceNamingInterface.nameResource(fileObject.getName().getBaseName(), fileObject.getParent().getName().getPath(), space.toString(), FileNamingType.DATA_FILE);
			}
		}
		
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:24,代码来源:TextFileOutputMeta.java

示例7: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of the base path into an absolute path.
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		// 
		if (!Const.isEmpty(filename)) {
			FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(filename));
			filename = resourceNamingInterface.nameResource(fileObject.getName().getBaseName(), fileObject.getParent().getName().getPath(), space.toString(), FileNamingType.DATA_FILE);
		}
		
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:AccessOutputMeta.java

示例8: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		//
		// From : ${Internal.Transformation.Filename.Directory}/../foo/bar.data
		// To   : /home/matt/test/files/foo/bar.data
		//
		FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(filename));
			
		// If the file doesn't exist, forget about this effort too!
		//
		if (fileObject.exists()) {
			// Convert to an absolute path...
			// 
			filename = resourceNamingInterface.nameResource(fileObject.getName().getBaseName(), fileObject.getParent().getName().getPath(), space.toString(), FileNamingType.DATA_FILE);
			
			return filename;
		}
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:CubeInputMeta.java

示例9: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		// In case the name of the file comes from previous steps, forget about this!
		//
		if (!isFoldernameDynamic) {
            for (int i=0;i<folderName.length;i++) {
              FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(folderName[i]), space);
              folderName[i] = resourceNamingInterface.nameResource(fileObject, space, true);
            }
		}
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:25,代码来源:GetSubFoldersMeta.java

示例10: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		// 
		// From : ${Internal.Transformation.Filename.Directory}/../foo/bar.txt
		// To   : /home/matt/test/files/foo/bar.txt
		//
		FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(filename), space);
		
           // If the file doesn't exist, forget about this effort too!
           //
           if (fileObject.exists()) {
               // Convert to an absolute path...
               // 
               filename = resourceNamingInterface.nameResource(fileObject, space, true);
               
               return filename;
           }
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:32,代码来源:FixedInputMeta.java

示例11: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		// In case the name of the file comes from previous steps, forget about this!
		// 
		if (!filefield) {
             
             // Replace the filename ONLY (folder or filename)
             // 
             for (int i=0;i<fileName.length;i++) {
               FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(fileName[i]), space);
               fileName[i] = resourceNamingInterface.nameResource(fileObject, space, Const.isEmpty(fileMask[i]));
             }
           }
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:28,代码来源:GetFileNamesMeta.java

示例12: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		//
		// From : ${Internal.Transformation.Filename.Directory}/../foo/bar.data
		// To   : /home/matt/test/files/foo/bar.data
		//
		FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(fileName), space);
			
		// If the file doesn't exist, forget about this effort too!
		//
		if (fileObject.exists()) {
			// Convert to an absolute path...
			// 
			fileName = resourceNamingInterface.nameResource(fileObject, space, true);
			
			return fileName;
		}
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:32,代码来源:SQLFileOutputMeta.java

示例13: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
 * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that.

 * TODO: create options to configure this behavior 
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
	try {
		// The object that we're modifying here is a copy of the original!
		// So let's change the filename from relative to absolute by grabbing the file object...
		//
           // Replace the filename ONLY (folder or filename)
           // 
           for (int i=0;i<fileName.length;i++) {
             FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(fileName[i]), space);
             fileName[i] = resourceNamingInterface.nameResource(fileObject, space, Const.isEmpty(fileMask[i]));
           }
		return null;
	} catch (Exception e) {
		throw new KettleException(e); //$NON-NLS-1$
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:AccessInputMeta.java

示例14: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
@Override
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
     try {
       // The object that we're modifying here is a copy of the original!
       // So let's change the filename from relative to absolute by grabbing the file object...
       //
       if (!fileinfield) {
           for (int i=0;i<fileName.length;i++) {
             FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(fileName[i]), space);
             fileName[i] = resourceNamingInterface.nameResource(fileObject, space, Const.isEmpty(fileMask[i]));
           }
       }
       return null;
     } catch (Exception e) {
         throw new KettleException(e); //$NON-NLS-1$
     }
   }
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:LoadFileInputMeta.java

示例15: exportResources

import org.pentaho.di.resource.ResourceDefinition; //导入依赖的package包/类
/**
 * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively.
 * So what this does is turn the name of the base path into an absolute path.
 */
public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions,
    ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException {
  try {
    // The object that we're modifying here is a copy of the original!
    // So let's change the filename from relative to absolute by grabbing the file object...
    // 
    if (!Const.isEmpty(fileName)) {
      FileObject fileObject = KettleVFS.getFileObject(space.environmentSubstitute(fileName), space);
      fileName = resourceNamingInterface.nameResource(fileObject, space, true);
    }

    return null;
  } catch (Exception e) {
    throw new KettleException(e); //$NON-NLS-1$
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:21,代码来源:XMLOutputMeta.java


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