@Test public void testMap() { assertTrue(new IRODSExceptionMappingService().map(new CatNoAccessException("no access")) instanceof AccessDeniedException); assertTrue(new IRODSExceptionMappingService().map(new FileNotFoundException("no file")) instanceof NotfoundException); assertTrue(new IRODSExceptionMappingService().map(new AuthenticationException("no user")) instanceof LoginFailureException); }
@Override public BackgroundException map(final JargonException e) { final StringBuilder buffer = new StringBuilder(); this.append(buffer, e.getMessage()); if(e instanceof CatNoAccessException) { return new AccessDeniedException(buffer.toString(), e); } if(e instanceof FileNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof DataNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof AuthenticationException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidUserException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidGroupException) { return new LoginFailureException(buffer.toString(), e); } return this.wrap(e, buffer); }
IRODSExceptionMappingService extends AbstractExceptionMappingService<JargonException> { @Override public BackgroundException map(final JargonException e) { final StringBuilder buffer = new StringBuilder(); this.append(buffer, e.getMessage()); if(e instanceof CatNoAccessException) { return new AccessDeniedException(buffer.toString(), e); } if(e instanceof FileNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof DataNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof AuthenticationException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidUserException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidGroupException) { return new LoginFailureException(buffer.toString(), e); } return this.wrap(e, buffer); } }
IRODSExceptionMappingService extends AbstractExceptionMappingService<JargonException> { @Override public BackgroundException map(final JargonException e) { final StringBuilder buffer = new StringBuilder(); this.append(buffer, e.getMessage()); if(e instanceof CatNoAccessException) { return new AccessDeniedException(buffer.toString(), e); } if(e instanceof FileNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof DataNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof AuthenticationException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidUserException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidGroupException) { return new LoginFailureException(buffer.toString(), e); } return this.wrap(e, buffer); }  }
IRODSExceptionMappingService extends AbstractExceptionMappingService<JargonException> { @Override public BackgroundException map(final JargonException e) { final StringBuilder buffer = new StringBuilder(); this.append(buffer, e.getMessage()); if(e instanceof CatNoAccessException) { return new AccessDeniedException(buffer.toString(), e); } if(e instanceof FileNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof DataNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof AuthenticationException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidUserException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidGroupException) { return new LoginFailureException(buffer.toString(), e); } return this.wrap(e, buffer); }  @Override BackgroundException map(final JargonException e); }
IRODSExceptionMappingService extends AbstractExceptionMappingService<JargonException> { @Override public BackgroundException map(final JargonException e) { final StringBuilder buffer = new StringBuilder(); this.append(buffer, e.getMessage()); if(e instanceof CatNoAccessException) { return new AccessDeniedException(buffer.toString(), e); } if(e instanceof FileNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof DataNotFoundException) { return new NotfoundException(buffer.toString(), e); } if(e instanceof AuthenticationException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidUserException) { return new LoginFailureException(buffer.toString(), e); } if(e instanceof InvalidGroupException) { return new LoginFailureException(buffer.toString(), e); } return this.wrap(e, buffer); }  @Override BackgroundException map(final JargonException e);  }