1 14 15 package com.ibm.webdav; 16 17 import java.util.logging.*; 18 19 import org.w3c.dom.Element ; 20 21 import com.ibm.webdav.basicsearch.BasicSearchRequest; 22 23 24 28 public class SearchRequestFactory { 29 30 33 private static final Logger m_logger = Logger.getLogger(SearchRequestFactory.class.getName()); 34 35 public SearchRequestFactory() { 36 } 37 38 public static SearchRequest getSearchRequest(Element xmlElement) 39 throws WebDAVException { 40 SearchRequest request = null; 41 42 try { 43 if (xmlElement.getNamespaceURI().equals("DAV:") && 44 xmlElement.getLocalName() 45 .equals(BasicSearchRequest.TAG_BASICSEARCH)) { 46 request = new BasicSearchRequest(); 47 48 request.instantiateFromXML(xmlElement); 49 } 50 } catch (WebDAVException e) { 51 throw e; 52 } catch (Exception e) { 53 m_logger.log(Level.WARNING, e.getLocalizedMessage(), e); 54 throw new WebDAVException(WebDAVStatus.SC_INTERNAL_SERVER_ERROR, 55 e.getMessage()); 56 } 57 58 return request; 59 } 60 } | Popular Tags |