package water.hdfs;

import H2OInit.Boot;

import water.H2O;
import water.Log;

public class Hdfs {
  private static final String DEFAULT_HDFS_VERSION = "cdh4";
  private static final String MAPRFS_HDFS_VERSION = "0.20.2";

  public static boolean initialize() {
    assert (H2O.OPT_ARGS.hdfs != null);
    if (H2O.OPT_ARGS.hdfs.equals("resurrect")) {
      throw new Error("HDFS resurrection is unimplemented");
    } else {
      // Load the HDFS backend for existing hadoop installations.
      // understands -hdfs=hdfs://server:port OR -hdfs=maprfs:///mapr/node_name/volume
      //             -hdfs-root=root
      //             -hdfs-config=config file
      String version = H2O.OPT_ARGS.hdfs_version==null ? DEFAULT_HDFS_VERSION : H2O.OPT_ARGS.hdfs_version;
      // If HDFS URI is MapR-fs - Switch two MapR version of hadoop
      version = version.equals("mapr") || (H2O.OPT_ARGS.hdfs.startsWith("maprfs://")) ? MAPRFS_HDFS_VERSION : version;
      try {
        if( Boot._init.fromJar() )
          Boot._init.addInternalJars("hadoop/"+version+"/");
      } catch(Exception e) {
        e.printStackTrace();
        Log.die("[hdfs] Unable to initialize hadoop version " + version +
            " please use different version.");
        return false;
      }
      PersistHdfs.ROOT.toString(); // Touch & thus start HDFS
      return true;
    }
  }
}

@@ -25,20 +25,20 @@
 ort 
-H2OInit.Boot
+java.io.File
 ;%0A%0Ai
@@ -71,16 +71,37 @@
 ter.Log;
+%0Aimport H2OInit.Boot;
 %0A%0Apublic
@@ -1016,17 +1016,150 @@
 mJar() )
+ %7B
 %0A
+          File f = new File(version);%0A          if( f.exists() ) %7B%0A            Boot._init.addExternalJars(f);%0A          %7D else %7B%0A  
         
@@ -1207,24 +1207,46 @@
 rsion+%22/%22);%0A
+          %7D%0A        %7D%0A
       %7D catc

Make hadoop_version able to take a jar directory