@@ -0,0 +1,956 @@
+package com.splunk.shep.customsearch;%0A%0Aimport java.net.URI;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.fs.FSDataInputStream;%0Aimport org.apache.hadoop.fs.FileSystem;%0Aimport org.apache.hadoop.fs.Path;%0A%0Apublic class HDFSCat %7B%0A%0A    public static void main(String args%5B%5D) %7B%0A%09try %7B%0A%09    Configuration conf = new Configuration();%0A%09    URI fileuri = URI.create(args%5B0%5D);%0A%09    String host = fileuri.getHost();%0A%09    int port = fileuri.getPort();%0A%09    FileSystem fs = FileSystem.get(%0A%09%09    URI.create(%22hdfs://%22 + host + %22:%22 + port), conf);%0A%09    Path filenamePath = new Path(args%5B0%5D);%0A%09    if (!fs.exists(filenamePath)) %7B%0A%09%09System.exit(1);%0A%09    %7D%0A%09    FSDataInputStream in = fs.open(filenamePath);%0A%09    while (true) %7B%0A%09%09String line = in.readLine();%0A%09%09if (line == null) %7B%0A%09%09    break;%0A%09%09%7D%0A%09%09System.out.println(line);%0A%09    %7D%0A%09    in.close();%0A%09%7D catch (Exception e) %7B%0A%09    e.printStackTrace();%0A%09    System.exit(2);%0A%09%7D%0A%09System.exit(0);%0A    %7D%0A%7D%0A

Use to cat an HDFS file