aQute.bnd.osgi.Builder.get()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(178)

本文整理了Java中aQute.bnd.osgi.Builder.get()方法的一些代码示例,展示了Builder.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Builder.get()方法的具体详情如下:
包路径:aQute.bnd.osgi.Builder
类名称:Builder
方法名:get

Builder.get介绍

[英]Answer the string of the resource that it has in the container. It is possible that the resource is a classpath entry. In that case an empty string is returned.
[中]回答容器中资源的字符串。资源可能是类路径条目。在这种情况下,将返回一个空字符串。

代码示例

代码示例来源:origin: stackoverflow.com

Form form = new Form();
form.add("x", "foo");
form.add("y", "bar");

Client client = ClientBuilder.newClient();

WebTarget resource = client.target("http://localhost:8080/someresource");

Builder request = resource.request();
request.accept(MediaType.APPLICATION_JSON);

Response response = request.get();

if (response.getStatusInfo().getFamily() == Family.SUCCESSFUL) {
  System.out.println("Success! " + response.getStatus());
  System.out.println(response.getEntity());
} else {
  System.out.println("ERROR! " + response.getStatus());    
  System.out.println(response.getEntity());
}

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) {
  Client cl = ClientBuilder.newClient();
  WebTarget target = cl.target("http://localhost:8080/simple-service-webapp/resources/myresource/usernamepwdcontext");
  target.path("resource");
  Builder requestBuilder = target.request();
  Response response = requestBuilder.get();
  System.out.println(response.getStatus());
  System.out.println(response.readEntity(String.class));
}

代码示例来源:origin: stackoverflow.com

protected ClientResponse executeGet(String path){
  WebResource resource = resource().path(path);
  Builder builder = resource.header("Content-Type", "application/json;charset=UTF-8");
  return builder.get(ClientResponse.class);
}

代码示例来源:origin: stackoverflow.com

protected ClientResponse executeGet(String path){
  WebResource resource = resource().path(path);
  Builder builder = resource.header("Content-Type", "application/json;charset=UTF-8");
  return builder.get(ClientResponse.class);
}

代码示例来源:origin: stackoverflow.com

WebResource res = c.resource("http://localhost:5984/");
Builder builder = res.accept(MediaType.APPLICATION_JSON_TYPE);
System.out.println(builder.get(String.class));

代码示例来源:origin: stackoverflow.com

WebResource resource = client.resource(url); 
Builder builder = resource.accept(MediaType.APPLICATION_JSON); 
GenericType<List<EMailInformations>> genericType = 
 new GenericType<List<EMailInformations>>() {};

List<EMailInformations> response = builder.get(genericType);

代码示例来源:origin: stackoverflow.com

Builder builder = webResource.path("/yourapi/").accept("application/xml");

// get the client response
ClientResponse response = builder.get(ClientResponse.class);

// log the HTTP Status
logger.log("HTTP Status: " + response.getStatus());

// bypass the jaxb step and get the full response
// MyResource myResource = response.getEntity(MyResource.class);
String myResource = response.getEntity(String.class);
logger.log(myResource);

代码示例来源:origin: stackoverflow.com

ClientResponse clientResponse = createMock(ClientResponse.class);
expect(clientResponse.getStatus()).andReturn(200).anyTimes();
expect(clientResponse.getEntity(FOO.class)).andReturn(jobInfo).anyTimes();
replay(clientResponse);

Builder builder = createMock(Builder.class);
expect(builder.get(ClientResponse.class)).andReturn(clientResponse).anyTimes();
replay(builder);

WebResource jobResource = createMock(WebResource.class);
expect(jobResource.accept(MediaType.APPLICATION_JSON)).andReturn(builder).anyTimes();
replay(jobResource);

代码示例来源:origin: biz.aQute.bnd/bnd

private void prebuild(List<String> set, List<String> order, List<Builder> builders, String s) throws IOException {
  if (order.contains(s)) // Already done
    return;
  if (set.contains(s))
    error("Cyclic -prebuild dependency %s from %s", s, set);
  Builder b = new Builder(this);
  b.setProperties(getFile(s));
  String prebuild = b.get("prebuild");
  if (prebuild != null) {
    set.add(s);
    try {
      Collection<String> parts = split(prebuild);
      for (String p : parts) {
        prebuild(set, order, builders, p);
      }
    }
    finally {
      set.remove(s);
    }
  }
  order.add(s);
  builders.add(b);
}

代码示例来源:origin: stackoverflow.com

Mockito.when(mockBuilder.get()).thenReturn(this.mockResponse);
Mockito.when(mockBuilder.post(Matchers.any())).thenReturn(this.mockResponse);
Mockito.when(mockBuilder.put(Matchers.any())).thenReturn(this.mockResponse);

代码示例来源:origin: stackoverflow.com

responseList.add("foobar");
Mockito.when(requestBuilder.get(Matchers.eq(Response.class))).thenReturn(serviceResponse);

相关文章

Builder类方法