Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Configuration
- @ConfigurationProperties(prefix = "spring.exchange")
- public class MSExchangeConfig {
- .
- .
- .
- public ExchangeService buildExchangeService() throws ExchangeServiceNotBuiltException {
- ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
- ExchangeCredentials credentials = new WebCredentials(getUsername(), getPassword());
- service.setCredentials(credentials);
- try {
- service.setUrl(new URI(getUri()));
- } catch (URISyntaxException ex) {
- logger.error("URL problem when connecting to Exchange");
- logger.trace("{}", ex);
- throw new ExchangeServiceNotBuiltException();
- }
- return service;
- }
- .
- .
- .
- }
Advertisement
Add Comment
Please, Sign In to add comment