1 17 package org.alfresco.repo.webdav; 18 19 import javax.servlet.http.HttpServletResponse ; 20 21 26 public class WebDAVServerException extends Exception 27 { 28 private static final long serialVersionUID = -2949418282738082368L; 29 30 private int m_httpStatusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR; 31 private Throwable m_cause = null; 32 33 38 public WebDAVServerException(int httpStatusCode) 39 { 40 this(httpStatusCode, null); 41 } 42 43 49 public WebDAVServerException(int httpStatusCode, Throwable cause) 50 { 51 super(Integer.toString(httpStatusCode)); 52 53 m_httpStatusCode = httpStatusCode; 54 m_cause = cause; 55 } 56 57 62 public int getHttpStatusCode() 63 { 64 return m_httpStatusCode; 65 } 66 67 72 public Throwable getCause() 73 { 74 return m_cause; 75 } 76 77 80 public String toString() 81 { 82 String strErrorMsg = "HTTP Status Code: " + m_httpStatusCode; 83 84 if (m_cause != null) 85 { 86 strErrorMsg = strErrorMsg + " caused by: " + m_cause.toString(); 87 } 88 89 return strErrorMsg; 90 } 91 } 92 | Popular Tags |