]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
19318577835c1096a3b7edbba3d6f63a8713d8b2
[tmp/jakarta-migration.git] /
1 package org.collectionspace.services.nuxeo.client.java;
2
3 import org.collectionspace.services.common.document.DocumentException;
4 import org.nuxeo.ecm.core.api.WrappedException;
5
6 public class NuxeoDocumentException extends DocumentException {
7
8         /**
9          * 
10          */
11         private static final long serialVersionUID = 1L;
12
13         public NuxeoDocumentException() {
14                 super();
15         }
16
17         public NuxeoDocumentException(String msg) {
18                 super(msg);
19                 // TODO Auto-generated constructor stub
20         }
21
22         public NuxeoDocumentException(int errorCode) {
23                 super(errorCode);
24                 // TODO Auto-generated constructor stub
25         }
26
27         public NuxeoDocumentException(int errorCode, String errorReason) {
28                 super(errorCode, errorReason);
29                 // TODO Auto-generated constructor stub
30         }
31
32         public NuxeoDocumentException(String message, Throwable cause) {
33                 super(message, cause);
34                 // TODO Auto-generated constructor stub
35         }
36
37         public NuxeoDocumentException(Throwable cause) {
38                 super(cause);
39                 // TODO Auto-generated constructor stub
40         }
41         
42         @Override
43         public String getCausesClassName() {
44                 String result = null;
45                 Throwable cause = super.getCause();
46                 
47                 if (cause != null && cause instanceof WrappedException) {
48                         WrappedException wrappedException = (WrappedException)cause;
49                         result = wrappedException.getClassName();
50                 } else {
51                         result = cause != null ? super.getCausesClassName() : null;
52                 }
53                 
54                 return result;
55         }
56                 
57         protected boolean isNuxeoWrappedException(Throwable cause) {
58                 boolean result = false;
59                 
60                 String className = cause.getClass().getCanonicalName();
61                 if (className.contains("org.nuxeo.ecm.core.api.WrappedException") == true) {
62                         result = true;
63                 }
64                 
65                 return result;
66         }
67         
68 }