001package org.kuali.ole.docstore.xstream; 002 003import java.io.BufferedReader; 004import java.io.File; 005import java.io.FileReader; 006import java.io.IOException; 007 008/** 009 * Created by IntelliJ IDEA. 010 * User: pvsubrah 011 * Date: 2/20/12 012 * Time: 12:11 AM 013 * To change this template use File | Settings | File Templates. 014 */ 015public class FileUtil { 016 017 public String readFile(File file) throws IOException { 018 BufferedReader reader = new BufferedReader(new FileReader(file)); 019 String line = null; 020 StringBuilder stringBuilder = new StringBuilder(); 021 String ls = System.getProperty("line.separator"); 022 while ((line = reader.readLine()) != null) { 023 stringBuilder.append(line); 024 stringBuilder.append(ls); 025 } 026 return stringBuilder.toString(); 027 } 028}