示例#1
0
 private GcfHttpRepresentation(String url, RequestInfo requestInfo, String eTag)
     throws IOException {
   this.originalRequest = requestInfo;
   DateTime requestTime = DateTime.now();
   connection = (HttpConnection) Connector.open(url);
   meta = new LiveGcfResponseInfo(connection, requestTime);
   connection.setRequestProperty(RequestHeaderName.IfNoneMatch.name(), eTag);
   is = connection.openInputStream();
 }
示例#2
0
 private GcfHttpRepresentation(String url, RequestInfo requestInfo) throws IOException {
   this.originalRequest = requestInfo;
   DateTime requestTime = DateTime.now();
   System.out.println(url);
   connection = open(url);
   setRequestHeaders(connection, requestInfo);
   is = openStream(connection);
   meta = getResponseInfo(connection, is, requestTime);
 }