Class JarFinder
java.lang.Object
org.apache.hadoop.hbase.mapreduce.JarFinder
Finds the Jar for a class. If the class is in a directory in the classpath, it creates a Jar on
the fly with the contents of the directory and returns the path to that Jar. If a Jar is created,
it is created in the system temporary directory. This file was forked from
hadoop/common/branches/branch-2@1377176.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcopyToZipStream(File file, ZipEntry entry, ZipOutputStream zos) private static voidstatic StringReturns the full path to the Jar containing the class.static voidjarDir(File dir, String relativePath, ZipOutputStream zos) private static voidzipDir(File dir, String relativePath, ZipOutputStream zos, boolean start)
-
Constructor Details
-
JarFinder
private JarFinder()
-
-
Method Details
-
copyToZipStream
private static void copyToZipStream(File file, ZipEntry entry, ZipOutputStream zos) throws IOException - Throws:
IOException
-
jarDir
- Throws:
IOException
-
zipDir
private static void zipDir(File dir, String relativePath, ZipOutputStream zos, boolean start) throws IOException - Throws:
IOException
-
createJar
- Throws:
IOException
-
getJar
Returns the full path to the Jar containing the class. It always return a JAR.- Parameters:
klass- class.- Returns:
- path to the Jar containing the class.
-