Package org.rssowl.core.connection.auth

Examples of org.rssowl.core.connection.auth.ICredentialsProvider


   */
  @Test
  @SuppressWarnings("nls")
  public void testProtectedFeed() throws Exception {
    ConnectionManager conManager = ConnectionManager.getDefault();
    ICredentialsProvider credProvider = conManager.getCredentialsProvider();

    URL feedUrl = new URL("http://www.rssowl.org/rssowl2dg/tests/connection/authrequired/feed_rss.xml");
    IFeed feed = new Feed(feedUrl);
    AuthenticationRequiredException e = null;

    try {
      conManager.load(feed.getLink());
    } catch (AuthenticationRequiredException e1) {
      e = e1;
    }

    assertNotNull(e);

    ICredentials credentials = new ICredentials() {
      public String getDomain() {
        return null;
      }

      public String getPassword() {
        return "admin";
      }

      public String getUsername() {
        return "bpasero";
      }
    };

    credProvider.setAuthCredentials(credentials, feedUrl);

    InputStream inS = conManager.load(feed.getLink());
    assertNotNull(inS);

    Interpreter.getDefault().interpret(inS, feed);
View Full Code Here

TOP

Related Classes of org.rssowl.core.connection.auth.ICredentialsProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.