org.pentaho.di.core.Const.splitPath()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中org.pentaho.di.core.Const.splitPath()方法的一些代码示例,展示了Const.splitPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Const.splitPath()方法的具体详情如下:
包路径:org.pentaho.di.core.Const
类名称:Const
方法名:splitPath

Const.splitPath介绍

[英]Convert strings separated by a string into an array of strings.

Example /a/b/c --> new String[] { a, b, c }
[中]将由字符串分隔的字符串转换为字符串数组。
Example /a/b/c --> new String[] { a, b, c }

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * Find a directory using the path to the directory with file.separator between the dir-names.
 *
 * @param path
 *          The path to the directory
 * @return The directory if one was found, null if nothing was found.
 */
@Override
public RepositoryDirectory findDirectory( String path ) {
 String[] newPath = Const.splitPath( path, DIRECTORY_SEPARATOR );
 String[] p = null;
 if ( parent == null ) {
  // This doesn't include the root:
  p = new String[newPath.length + 1];
  p[0] = DIRECTORY_SEPARATOR;
  for ( int i = 0; i < newPath.length; i++ ) {
   p[i + 1] = newPath[i];
  }
 } else {
  p = newPath;
 }
 return findDirectory( p );
}

代码示例来源:origin: pentaho/pentaho-kettle

String[] path = Const.splitPath( directoryPath, RepositoryDirectory.DIRECTORY_SEPARATOR );

代码示例来源:origin: pentaho/pentaho-kettle

List<String> targetPath = new ArrayList( Arrays.asList( Const.splitPath( targetFilePath,
 RepositoryDirectory.DIRECTORY_SEPARATOR  ) ) );
final String fileName = targetPath.get( targetPath.size() - 1 ).replace( ".ktr", "" );

代码示例来源:origin: pentaho/pentaho-kettle

String[] path = Const.splitPath( directoryPath, RepositoryDirectory.DIRECTORY_SEPARATOR );

相关文章