public static String[] getPaths(String fullpath) {
    ArrayList<String> paths = new ArrayList<String>();
    if (fullpath.length() < 2) {
      paths.add(fullpath);
    } else {
      int location = 0;
      while ((location = fullpath.indexOf("/", location + 1)) > 0) {
        paths.add(fullpath.substring(0, location));
      }
      paths.add(fullpath);
    }
    String[] strings = new String[paths.size()];
    return paths.toArray(strings);
  }
Get the path based on the job type.

@param type
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/ZooKeeperStorage.java