1 28 29 package com.caucho.servlets.webdav; 30 31 import com.caucho.vfs.Path; 32 33 import javax.servlet.ServletContext ; 34 import javax.servlet.http.HttpServletRequest ; 35 import java.io.IOException ; 36 import java.util.logging.Level ; 37 38 41 public class FilePath extends ApplicationPath { 42 private Path _root; 43 44 public FilePath() 45 { 46 } 47 48 public FilePath(Path root) 49 { 50 try { 51 root.mkdirs(); 52 } catch (IOException e) { 53 log.log(Level.WARNING, e.toString(), e); 54 } 55 56 setRoot(root); 57 } 58 59 62 public void setRoot(Path path) 63 { 64 _root = path; 65 } 66 67 70 public Path getRoot() 71 { 72 return _root; 73 } 74 75 78 protected Path getPath(String path, 79 HttpServletRequest request, 80 ServletContext app) 81 throws IOException 82 { 83 return _root.lookup("./" + path); 84 } 85 86 public String toString() 87 { 88 return "FilePath[" + _root + "]"; 89 } 90 } 91 | Popular Tags |