1 25 26 package net.killingar.actions; 27 28 import java.io.File ; 29 import java.io.FileReader ; 30 31 public class ViewTxt extends PathActionSupport 32 { 33 35 String name; 37 FileReader body; 38 39 public String getName() { return name; } 41 public FileReader getBody() { return body; } 42 43 public void setName(String inName) { name = inName; } 45 46 public String doExecute() 48 { 49 try 50 { 51 File f = new File (realPath); 52 body = new FileReader (f.getAbsolutePath()+"\\"+name); 53 } 54 catch (Exception e) 55 { 56 addErrorMessage("listing directory failed, exception thrown ("+e.toString()+")"); 57 e.printStackTrace(); 58 59 return ERROR; 60 } 61 62 return SUCCESS; 63 } 64 } 65 | Popular Tags |