1 19 20 package org.netbeans.modules.web.jspcompiler; 21 22 import java.io.*; 23 24 28 public class SmapFileReader implements SmapReader { 29 30 private File file; 31 32 public SmapFileReader(java.io.File file) { 33 this.file = file; 34 } 35 36 public String toString() { 37 if (file != null) return file.toString(); 38 return null; 39 } 40 41 public String readSmap() { 42 if (file != null) { 43 try { 44 FileReader fr = new FileReader(file); 45 LineNumberReader lnr = new LineNumberReader(fr); 46 String line = ""; 47 String out = ""; 48 while ((line = lnr.readLine()) != null) { 49 out = out.concat(line); 50 out = out.concat("\n"); 51 } 52 return out; 53 } catch (FileNotFoundException fne) { 54 return null; 55 } catch (IOException ioe) { 56 return null; 57 } 58 } 59 return null; 60 } 61 62 63 } 64 | Popular Tags |