01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.repository.http;
07:
08: import java.io.IOException;
09:
10: import org.openrdf.query.MalformedQueryException;
11: import org.openrdf.query.QueryEvaluationException;
12: import org.openrdf.repository.RepositoryException;
13:
14: /**
15: *
16: * @author Herko ter Horst
17: */
18: public class HTTPQueryEvaluationException extends
19: QueryEvaluationException {
20:
21: private static final long serialVersionUID = -8315025167877093272L;
22:
23: /**
24: * @param msg
25: */
26: public HTTPQueryEvaluationException(String msg) {
27: super (msg);
28: }
29:
30: /**
31: * @param msg
32: * @param cause
33: */
34: public HTTPQueryEvaluationException(String msg, Throwable cause) {
35: super (msg, cause);
36: }
37:
38: /**
39: * @param cause
40: */
41: public HTTPQueryEvaluationException(Throwable cause) {
42: super (cause);
43: }
44:
45: public boolean isCausedByIOException() {
46: return getCause() instanceof IOException;
47: }
48:
49: public boolean isCausedByRepositoryException() {
50: return getCause() instanceof RepositoryException;
51: }
52:
53: public boolean isCausedByMalformedQueryException() {
54: return getCause() instanceof MalformedQueryException;
55: }
56:
57: public IOException getCauseAsIOException() {
58: return (IOException) getCause();
59: }
60:
61: public RepositoryException getCauseAsRepositoryException() {
62: return (RepositoryException) getCause();
63: }
64:
65: public MalformedQueryException getCauseAsMalformedQueryException() {
66: return (MalformedQueryException) getCause();
67: }
68: }
|