org.apache.hadoop.util
Class RunJar

java.lang.Object
  extended by org.apache.hadoop.util.RunJar

public class RunJar
extends Object

Run a Hadoop job jar.


Field Summary
static Pattern MATCH_ANY
          Pattern that matches any string
 
Constructor Summary
RunJar()
           
 
Method Summary
static void main(String[] args)
          Run a Hadoop job jar.
static void unJar(File jarFile, File toDir)
          Unpack a jar file into a directory.
static void unJar(File jarFile, File toDir, Pattern unpackRegex)
          Unpack matching files from a jar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MATCH_ANY

public static final Pattern MATCH_ANY
Pattern that matches any string

Constructor Detail

RunJar

public RunJar()
Method Detail

unJar

public static void unJar(File jarFile,
                         File toDir)
                  throws IOException
Unpack a jar file into a directory. This version unpacks all files inside the jar regardless of filename.

Throws:
IOException

unJar

public static void unJar(File jarFile,
                         File toDir,
                         Pattern unpackRegex)
                  throws IOException
Unpack matching files from a jar. Entries inside the jar that do not match the given pattern will be skipped.

Parameters:
jarFile - the .jar file to unpack
toDir - the destination directory into which to unpack the jar
unpackRegex - the pattern to match jar entries against
Throws:
IOException

main

public static void main(String[] args)
                 throws Throwable
Run a Hadoop job jar. If the main class is not in the jar's manifest, then it must be provided on the command line.

Throws:
Throwable


Copyright © 2009 The Apache Software Foundation