/** * Wrap OpenCms into OpenCMIS exceptions and rethrow them.<p> * * @param e the exception to handle */ public static void handleCmsException(CmsException e) { if (e instanceof CmsVfsResourceNotFoundException) { throw new CmisObjectNotFoundException(e.getLocalizedMessage(), e); } else if (e instanceof CmsSecurityException) { throw new CmisUnauthorizedException(e.getLocalizedMessage(), e); } else { throw new CmisRuntimeException(e.getLocalizedMessage(), e); } }
return new CmisInvalidArgumentException(message, errorContent, t); case 401: return new CmisUnauthorizedException(message, errorContent, t); case 403: return new CmisPermissionDeniedException(message, errorContent, t);
return new CmisInvalidArgumentException(message, errorContent, t); case 401: return new CmisUnauthorizedException(message, errorContent, t); case 403: return new CmisPermissionDeniedException(message, errorContent, t);
return new CmisUnauthorizedException(message, errorContent, t); case 403: if (CmisStreamNotSupportedException.EXCEPTION_NAME.equals(exception)) {
return new CmisUnauthorizedException(message, errorContent, additionalData, t); case 403: if (CmisStreamNotSupportedException.EXCEPTION_NAME.equals(exception)) {
String message = "Cannot connect to Web Services [" + service.getServiceName() + "]: " + he.getMessage(); if (he.getStatusCode() == 401) { throw new CmisUnauthorizedException(message, he); } else if (he.getStatusCode() == 404) { throw new CmisObjectNotFoundException(message, he);