1 28 29 package com.caucho.servlets.webdav; 30 31 import com.caucho.log.Log; 32 import com.caucho.util.NullIterator; 33 34 import javax.servlet.ServletContext ; 35 import javax.servlet.http.HttpServletRequest ; 36 import java.io.IOException ; 37 import java.io.InputStream ; 38 import java.io.OutputStream ; 39 import java.util.Iterator ; 40 import java.util.logging.Logger ; 41 42 45 public abstract class AbstractPath { 46 protected static final Logger log = Log.open(AbstractPath.class); 47 48 55 public abstract boolean isFile(String path, 56 HttpServletRequest request, 57 ServletContext app) 58 throws IOException ; 59 60 67 public abstract boolean isDirectory(String path, 68 HttpServletRequest request, 69 ServletContext app) 70 throws IOException ; 71 72 79 public abstract boolean canRead(String path, 80 HttpServletRequest request, 81 ServletContext app) 82 throws IOException ; 83 84 91 public abstract boolean exists(String path, 92 HttpServletRequest request, 93 ServletContext app) 94 throws IOException ; 95 96 103 public abstract long getLength(String path, 104 HttpServletRequest request, 105 ServletContext app) 106 throws IOException ; 107 108 115 public abstract long getLastModified(String path, 116 HttpServletRequest request, 117 ServletContext app) 118 throws IOException ; 119 120 128 public Iterator getAttributeNames(String path, 129 HttpServletRequest request, 130 ServletContext app) 131 throws IOException 132 { 133 return NullIterator.create(); 134 } 135 136 144 public String getAttribute(AttributeName name, 145 String path, 146 HttpServletRequest request, 147 ServletContext app) 148 throws IOException 149 { 150 return null; 151 } 152 153 164 public boolean setAttribute(AttributeName name, String value, 165 String path, 166 HttpServletRequest request, 167 ServletContext app) 168 throws IOException 169 { 170 return false; 171 } 172 173 181 public boolean removeAttribute(AttributeName name, 182 String path, 183 HttpServletRequest request, 184 ServletContext app) 185 throws IOException 186 { 187 return false; 188 } 189 190 197 public abstract String []list(String path, 198 HttpServletRequest request, 199 ServletContext app) 200 throws IOException ; 201 202 211 public abstract boolean mkdir(String path, 212 HttpServletRequest request, 213 ServletContext app) 214 throws IOException ; 215 216 225 public abstract boolean rmdir(String path, 226 HttpServletRequest request, 227 ServletContext app) 228 throws IOException ; 229 230 241 public boolean rename(String path, 242 String destination, 243 HttpServletRequest request, 244 ServletContext app) 245 throws IOException 246 { 247 return false; 248 } 249 250 259 public abstract boolean remove(String path, 260 HttpServletRequest request, 261 ServletContext app) 262 throws IOException ; 263 264 273 public abstract OutputStream openWrite(String path, 274 HttpServletRequest request, 275 ServletContext app) 276 throws IOException ; 277 278 287 public abstract InputStream openRead(String path, 288 HttpServletRequest request, 289 ServletContext app) 290 throws IOException ; 291 292 295 public void destroy() 296 { 297 } 298 } 299 | Popular Tags |