本文整理汇总了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$
}
}
示例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$
}
}
示例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$
}
}
示例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$
}
}
示例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$
}
}
示例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$
}
}
示例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$
}
}
示例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$
}
}
示例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$
}
}
示例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$
}
}
示例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$
}
}
示例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$
}
}
示例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 );
}
}
示例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 );
}
}
示例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$
}
}