org.apache.hadoop.fs.FileUtil.createJarWithClassPath()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(182)

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

FileUtil.createJarWithClassPath介绍

[英]Create a jar file at the given path, containing a manifest with a classpath that references all specified entries. Some platforms may have an upper limit on command line length. For example, the maximum command line length on Windows is 8191 characters, but the length of the classpath may exceed this. To work around this limitation, use this method to create a small intermediate jar with a manifest that contains the full classpath. It returns the absolute path to the new jar, which the caller may set as the classpath for a new process. Environment variable evaluation is not supported within a jar manifest, so this method expands environment variables before inserting classpath entries to the manifest. The method parses environment variables according to platform-specific syntax (%VAR% on Windows, or $VAR otherwise). On Windows, environment variables are case-insensitive. For example, %VAR% and %var% evaluate to the same value. Specifying the classpath in a jar manifest does not support wildcards, so this method expands wildcards internally. Any classpath entry that ends with * is translated to all files at that path with extension .jar or .JAR.
[中]在给定的路径上创建一个jar文件,其中包含一个清单,清单的类路径引用所有指定的条目。某些平台的命令行长度可能有上限。例如,Windows上的最大命令行长度为8191个字符,但类路径的长度可能超过此长度。为了克服这个限制,使用这个方法创建一个小的中间jar,其中包含完整类路径的清单。它返回新jar的绝对路径,调用者可以将其设置为新进程的类路径。jar清单中不支持环境变量求值,因此此方法在将类路径项插入清单之前展开环境变量。该方法根据特定于平台的语法解析环境变量(%VAR%在Windows上,或$VAR否则)。在Windows上,环境变量不区分大小写。例如,%VAR%和%VAR%的计算结果相同。在jar清单中指定类路径不支持通配符,因此此方法在内部扩展通配符。任何以*结尾的类路径条目都将转换为该路径上具有扩展名的所有文件。罐或罐。罐子

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

public static String[] createJarWithClassPath(String inputClassPath, Path pwd,
  Map<String, String> callerEnv) throws IOException {
 return createJarWithClassPath(inputClassPath, pwd, pwd, callerEnv);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

final String tmpJarPath;
try {
 tmpJarPath = FileUtil.createJarWithClassPath(classPath, workingDir,
  System.getenv())[0];
} catch (IOException e) {

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

public static String[] createJarWithClassPath(String inputClassPath, Path pwd,
  Map<String, String> callerEnv) throws IOException {
 return createJarWithClassPath(inputClassPath, pwd, pwd, callerEnv);
}

代码示例来源:origin: io.hops/hadoop-common

public static String[] createJarWithClassPath(String inputClassPath, Path pwd,
  Map<String, String> callerEnv) throws IOException {
 return createJarWithClassPath(inputClassPath, pwd, pwd, callerEnv);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

public static String[] createJarWithClassPath(String inputClassPath, Path pwd,
  Map<String, String> callerEnv) throws IOException {
 return createJarWithClassPath(inputClassPath, pwd, pwd, callerEnv);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

public static String[] createJarWithClassPath(String inputClassPath, Path pwd,
  Map<String, String> callerEnv) throws IOException {
 return createJarWithClassPath(inputClassPath, pwd, pwd, callerEnv);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

jarDir = pwd;
String[] jarCp = FileUtil.createJarWithClassPath(
    newClassPath.toString(), jarDir, pwd, mergedEnv);

代码示例来源:origin: io.hops/hadoop-common

final String tmpJarPath;
try {
 tmpJarPath = FileUtil.createJarWithClassPath(classPath, workingDir,
  System.getenv())[0];
} catch (IOException e) {

代码示例来源:origin: ch.cern.hadoop/hadoop-common

final String tmpJarPath;
try {
 tmpJarPath = FileUtil.createJarWithClassPath(classPath, workingDir,
  System.getenv())[0];
} catch (IOException e) {

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

final String tmpJarPath;
try {
 tmpJarPath = FileUtil.createJarWithClassPath(classPath, workingDir,
  System.getenv())[0];
} catch (IOException e) {

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

final String tmpJarPath;
try {
 tmpJarPath = FileUtil.createJarWithClassPath(classPath, workingDir,
  System.getenv())[0];
} catch (IOException e) {

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager

String jarCp[] = FileUtil.createJarWithClassPath(classPath, 
  classpathJarPrivateDir, cwdPath, env);
String classPathJar = localizeClasspathJar(

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager

String jarCp[] = FileUtil.createJarWithClassPath(classPath, 
  classpathJarPrivateDir, cwdPath, env);
String classPathJar = localizeClasspathJar(

代码示例来源:origin: io.hops/hadoop-yarn-server-nodemanager

String jarCp[] = FileUtil.createJarWithClassPath(classPath,
  classpathJarPrivateDir, cwdPath, env);
String classPathJar = localizeClasspathJar(

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager

jarDir = pwd; 
String[] jarCp = FileUtil.createJarWithClassPath(
 newClassPath.toString(), jarDir, pwd, mergedEnv);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

String jarCp[] = FileUtil.createJarWithClassPath(classPath,
  classpathJarPrivateDir, cwdPath, env);
String classPathJar = localizeClasspathJar(

代码示例来源:origin: io.hops/hadoop-yarn-server-nodemanager

jarDir = pwd; 
String[] jarCp = FileUtil.createJarWithClassPath(
 newClassPath.toString(), jarDir, pwd, mergedEnv);

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager

jarDir = pwd; 
String[] jarCp = FileUtil.createJarWithClassPath(
 newClassPath.toString(), jarDir, pwd, mergedEnv);

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

"cp3.jar", nonExistentSubdir);
String inputClassPath = StringUtils.join(File.pathSeparator, classPaths);
String[] jarCp = FileUtil.createJarWithClassPath(inputClassPath + File.pathSeparator + "unexpandedwildcard/*",
 new Path(tmp.getCanonicalPath()), System.getenv());
String classPathJar = jarCp[0];

代码示例来源:origin: ch.cern.hadoop/hadoop-common

"cp3.jar", nonExistentSubdir);
String inputClassPath = StringUtils.join(File.pathSeparator, classPaths);
String[] jarCp = FileUtil.createJarWithClassPath(inputClassPath + File.pathSeparator + "unexpandedwildcard/*",
 new Path(tmp.getCanonicalPath()), System.getenv());
String classPathJar = jarCp[0];

相关文章