Package com.dongxuexidu.douban4j.model.user

Examples of com.dongxuexidu.douban4j.model.user.DoubanUserObj


    AtomContent content = null;
    if (requestObj != null) {
      content = AtomContent.forEntry(DefaultConfigs.DOUBAN_XML_NAMESPACE, requestObj);
    } else {
      //Obviously the null content (proved) is not accecptable to Douban's API. Therefore, this empty obj is added for fooling Douban around, they don't care what's inside it anyway.
      content = AtomContent.forEntry(DefaultConfigs.DOUBAN_XML_NAMESPACE, new DoubanUserObj());
    }
    HttpRequest method = requestFactory.buildPostRequest(new GenericUrl(url), content);
    HttpResponse response = httpRequest(method, needAccessToken);
    return response.getStatusCode();
  }
View Full Code Here


    super(accessToken);
  }
 
  public DoubanUserObj getUserProfileByUid (String uid) throws DoubanException, IOException {
    String url = RequestUrls.DOUBAN_USER_PREFIX + "/" + uid;
    DoubanUserObj result = this.client.getResponse(url, null, DoubanUserObj.class, false);
    return result;
  }
View Full Code Here

    return result;
  }
 
  public DoubanUserObj getLoggedInUserProfile (String accessToken) throws DoubanException, IOException {
    setAccessToken(accessToken);
    DoubanUserObj result = this.client.getResponse(RequestUrls.DOUBAN_USER_PREFIX + URLEncoder.encode("/@me", "utf-8"), null, DoubanUserObj.class, true);
    return result;
  }
View Full Code Here

   */
  public void testGetUserProfileByUid() throws Exception {
    System.out.println("getUserProfileByUid");
    String uid = "xxx";
    DoubanUserService instance = new DoubanUserService();
    DoubanUserObj result = instance.getUserProfileByUid(uid);
    assertEquals(result.getTitle(), "xxx");
  }
View Full Code Here

    System.out.println("getLoggedInUserProfile");
    if (accessToken == null) {
      accessToken = PlayGround.testAccessToken();
    }
    DoubanUserService instance = new DoubanUserService();
    DoubanUserObj result = instance.getLoggedInUserProfile(accessToken);
    assertEquals(result.getTitle(), "xxx");
  }
View Full Code Here

TOP

Related Classes of com.dongxuexidu.douban4j.model.user.DoubanUserObj

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.