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


Java ResourceNamingInterface.nameResource方法代码示例

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


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

示例1: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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

示例2: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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,代码来源:CubeInputMeta.java

示例3: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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) {
            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,代码行数:25,代码来源:PropertyInputMeta.java

示例4: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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

示例5: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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

示例6: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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,代码来源:ExcelOutputMeta.java

示例7: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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,代码来源:XMLInputMeta.java

示例8: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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,代码来源:CubeOutputMeta.java

示例9: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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 (!acceptingFilenames) {
             
             // 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,代码来源:TextFileInputMeta.java

示例10: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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

示例11: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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,代码行数:20,代码来源:ExcelOutputMeta.java

示例12: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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

示例13: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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.
 * 
 * @param space
 *          the variable space to use
 * @param definitions
 * @param resourceNamingInterface
 * @param repository
 *          The repository to optionally load other resources from (to be converted to XML)
 * @param metaStore
 *          the metaStore in which non-kettle metadata could reside.
 * 
 * @return the filename of the exported resource
 */
public String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
    ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore )
  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 ( !Utils.isEmpty( xsdFilename ) ) {
      FileObject fileObject = KettleVFS.getFileObject( space.environmentSubstitute( xsdFilename ), space );
      xsdFilename = resourceNamingInterface.nameResource( fileObject, space, true );
      return xsdFilename;
    }

    return null;
  } catch ( Exception e ) {
    throw new KettleException( e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:41,代码来源:XsdValidatorMeta.java

示例14: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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.
 *
 * @param space
 *          the variable space to use
 * @param definitions
 * @param resourceNamingInterface
 * @param repository
 *          The repository to optionally load other resources from (to be converted to XML)
 * @param metaStore
 *          the metaStore in which non-kettle metadata could reside.
 *
 * @return the filename of the exported resource
 */
public String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
  ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ) 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 );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:43,代码来源:SQLFileOutputMeta.java

示例15: exportResources

import org.pentaho.di.resource.ResourceNamingInterface; //导入方法依赖的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:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:32,代码来源:FixedInputMeta.java


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