1 14 package org.wings.template; 15 16 import java.io.File ; 17 import java.io.FileInputStream ; 18 import java.io.IOException ; 19 import java.io.InputStream ; 20 21 28 public class FileTemplateSource implements TemplateSource { 29 private File file; 30 protected String canonicalName = null; 31 32 public FileTemplateSource(File f) { 33 this.file = f; 34 if (file != null) { 35 try { 36 canonicalName = "file:" + file.getCanonicalPath(); 37 } catch (IOException e) { 38 } 40 } 41 } 42 43 46 public String getCanonicalName() { 47 return canonicalName; 48 } 49 50 61 public long lastModified() { 62 return file.lastModified(); 63 } 64 65 68 public InputStream getInputStream() 69 throws IOException { 70 return new FileInputStream (file); 71 } 72 } 73 74 75 76 77 | Popular Tags |