Package org.jrest4guice.client

Examples of org.jrest4guice.client.JRestClient


    String[] urls = service_url.toString().split(",");
    this.remoteServiceUrls = Arrays.asList(urls);

    this.service_url_relation = new HashMap<String, String>();

    this.client = new JRestClient();
  }
View Full Code Here


    if(!this.roleListUrl.endsWith("/"))
      this.roleListUrl += "/";
  }

  public boolean login() throws LoginException {
    this.client = new JRestClient();
    // 提示输入用户名和密码;
    if (callbackHandler == null) {
      throw new LoginException("没有指明 CallBackHandler!");
    }
    Callback[] callbacks = new Callback[2];
View Full Code Here

public class JaasTest {
  private static JRestClient client;

  @BeforeClass
  public static void setUp() throws Exception {
    client = new JRestClient();
  }
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    JRestClient client = new JRestClient();
    try {
      Object result = client.uploadFiles(
          "http://sample.snifast.com/full/fileUpload", null,
          new File[] { new File("F:\\KuGou\\陈倩倩 - 婴儿.mp3"),
              new File("F:\\KuGou\\wendy.jpg") });
      System.out.println(result);
    } catch (Exception e) {
View Full Code Here

public class TestRemoteCall {
  @SuppressWarnings("unchecked")
  public static void main(String[] args) throws Exception {
    //通过JRestClient直接访问rest资源
    JRestClient client = new JRestClient();
    ModelMap<String, Object> urlParam = new ModelMap<String, Object>();
    urlParam.put("pageIndex", "1");
    urlParam.put("pageSize", "5");
    Object result = client.callRemote("http://localhost/full/resource/contacts",
        "get", urlParam);

    Page<Contact> page = (Page<Contact>) result;
    List<Contact> contacts = page.getResult();
    for (Contact ct : contacts)
      System.out.println(ct.getName());

    System.out.println("==================================");
    List<Role> roles = (List<Role>) client.callRemote(
        "http://localhost/full/resource/security/cnoss/roles", "get", null);
    for (Role r : roles)
      System.out.println(r.getName());

    System.out.println("==================================");
View Full Code Here

TOP

Related Classes of org.jrest4guice.client.JRestClient

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.