public static String readFromFile(final File path) throws IOException {
  FileInputStream fis=null;
  try {
    fis=new FileInputStream(path);
    return readFromFile(fis);
  }
  finally {
    if (fis != null) {
      fis.close();
    }
  }
}

public static String readFromFile ( final File path ) throws IOException { FileInputStream fis = null ; try { fis = new FileInputStream ( path ) ; return readFromFile ( fis ) ; } finally { if ( fis != null ) { fis . close ( ) ; } } }
read contents of a file .
