Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private InputStream getCeResourceAndWrapExceptions(String path, boolean suppressObjectNotFound) {
- Preconditions.checkNotNull(path, "Argument: 'path' can't be null.");
- if (logger != null) logger.trace("Full file path: {}", path);
- else System.out.println("Full file path: " + path);
- try {
- System.out.println("getCeResourceAndWrapExceptions before getCeResource");
- return getCeResource(path);
- } catch (EngineRuntimeException e) {
- System.out.println("getCeResourceAndWrapExceptions Exception " +e.getMessage());
- if (e.getExceptionCode() == ExceptionCode.E_OBJECT_NOT_FOUND) {
- if (suppressObjectNotFound) {
- System.out.println("getCeResourceAndWrapExceptions Exception not found return null ");
- return null;
- }
- throw ExceptionUtils.createException(ObjectNotFoundException.class, ru.brbpm.lecm.shared.exceptions
- .ExceptionCode.GENERIC_OBJECT_NOT_FOUND, path);
- } else if (e.getExceptionCode() == ExceptionCode.E_ACCESS_DENIED) {
- throw ExceptionUtils.createException(AccessDeniedException.class, ru.brbpm.lecm.shared.exceptions
- .ExceptionCode.GENERIC_ACCESS_DENIED);
- } else {
- throw e;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement