org.simpleframework.http.Address.toString()方法的使用及代码示例

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

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

Address.toString介绍

[英]This is used to convert this URI object into a String object. This will only convert the parts of the URI that exist, so the URI may not contain the domain or the query part and it will not contain the path parameters. If the URI contains all these parts then it will return something like

scheme://host:port/path/path?querypart

It can return /path/path?querypart style relative URI's. If any of the parts are set to null then that part will be missing, for example if only the path is available then this will omit the domain, port and scheme. Showing a relative address.

scheme://host:port/?querypart

[中]这用于将此URI对象转换为String对象。这将只转换URI中存在的部分,因此URI可能不包含域或查询部分,也不包含路径参数。如果URI包含所有这些部分,那么它将返回类似

scheme://host:port/path/path?querypart

它可以返回/path/path?querypart样式的相对URI。如果任何部分设置为null,则该部分将丢失,例如,如果只有路径可用,则将忽略域、端口和方案。显示相对地址。

scheme://host:port/?querypart

代码示例

代码示例来源:origin: mpetazzoni/ttorrent

myRequestProcessor.process(request.getAddress().toString(), request.getClientAddress().getAddress().getHostAddress(),
     getRequestHandler(response));
} else {
 myMultiAnnounceRequestProcessor.process(request.getContent(), request.getAddress().toString(),
     request.getClientAddress().getAddress().getHostAddress(), getRequestHandler(response));

代码示例来源:origin: miltonio/milton2

@Override
public String getFromAddress() {
  Address add = baseRequest.getAddress();
  if (add == null) {
    return null;
  }
  return add.toString();
}

代码示例来源:origin: miltonio/milton2

@Override
public String toString() {
  return request.getMethod() + " " + request.getAddress().toString();
}

代码示例来源:origin: org.kie.remote/kie-remote-client

public void handle( Request req, Response resp ) {
  try {
    PrintStream out = resp.getPrintStream(1024);
    String address = req.getAddress().toString();
    if( address.equals(DEFAULT_ENPOINT) ) {
      String content = readInputStreamAsString(req.getInputStream());
      JaxbCommandsRequest cmdsReq = (JaxbCommandsRequest) jaxbSerializationProvider.deserialize(content);
      String [] headerNames = {
          TEST_HEADER_NAME,
          ANOTHER_TEST_HEADER_NAME,
          NOT_SENT_HEADER_NAME
      };
      List<String> headerValues = new ArrayList<String>();
      for( String headerName : headerNames ) {
        String headerVal = req.getValue(headerName);
        if( headerVal != null ) {
          headerValues.add(headerVal);
        }
      }
      String output = handleJaxbCommandsRequest(cmdsReq, headerValues);
      resp.setCode(HttpURLConnection.HTTP_OK);
      out.print(output);
    } else {
      resp.setCode(HttpURLConnection.HTTP_BAD_REQUEST);
    }
    out.close();
  } catch( Exception e ) {
    e.printStackTrace();
  }
}

代码示例来源:origin: org.kie.remote/kie-remote-client

logger.debug(headers[0] + ": " + user + "/" + pass);
String address = req.getAddress().toString();
if( address.equals(DEFAULT_ENDPOINT) ) {
  resp.setValue(HttpHeaders.CONTENT_TYPE, "text/plain");

代码示例来源:origin: org.kie.remote/kie-remote-client

public void handle( Request req, Response resp ) {
  try {
    PrintStream out = resp.getPrintStream(1024);
    String address = req.getAddress().toString();
    if( address.equals(REDIRECT_PATH) ) {
      resp.setValue(HttpHeaders.LOCATION, REAL_ENDPOINT_PATH);

相关文章