1 23 24 package org.apache.slide.webdav; 25 26 import org.apache.slide.webdav.method.DefaultMethodFactory; 27 28 32 public abstract class WebdavMethodFactory { 33 34 35 37 39 44 public static WebdavMethodFactory newInstance(WebdavServletConfig config) { 45 46 WebdavMethodFactory factory = null; 47 String className = config.getMethodFactory(); 48 if (className != null) { 49 try { 50 Class factoryClass = Class.forName(className); 51 factory = (WebdavMethodFactory)factoryClass.newInstance(); 52 } catch (Exception e) { 53 } 55 } 56 57 if (factory == null) { 58 factory = new DefaultMethodFactory(); 59 } 60 factory.setConfig(config); 61 62 return factory; 63 } 64 65 66 68 69 76 public abstract WebdavMethod createMethod(String name); 77 78 79 81 82 87 protected abstract void setConfig(WebdavServletConfig config); 88 89 90 } 91 92 | Popular Tags |