Java tutorial
//package com.java2s; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static String dumpFile(String filename) { String line = ""; try { Process ifc = Runtime.getRuntime().exec("cat " + filename); BufferedReader bis = new BufferedReader(new InputStreamReader(ifc.getInputStream())); line = bis.readLine(); ifc.destroy(); } catch (java.io.IOException e) { return new String(""); } return line; } }