Package com.dbxml.labrador

Examples of com.dbxml.labrador.Request


         boolean restHandler = handler instanceof RESTHandler;
         boolean httpEndpoint = endpoint instanceof HTTPServerBase;

         if ( restHandler && httpEndpoint ) {
            Request request = context.getRequest();
            Response response = context.getResponse();

            RecordMetaData meta = col.getRecordMetaData(tx, key);
            if ( meta != null ) {
               Long lm = (Long)meta.getValue(RecordMetaData.MODIFIED);
               if ( lm != null ) {
                  String lastModified = GDF.format(new Date(lm.longValue()));

                  response.setHeader(HTTP.HEADER_CACHE_CONTROL, HTTP.VALUE_CACHE);
                  response.setHeader(HTTP.HEADER_LAST_MODIFIED, lastModified);

                  String since = request.getHeader(HTTP.HEADER_IF_MODIFIED_SINCE);
                  if ( since != null && since.length() > 0 && since.equals(lastModified) )
                     throw new HTTPException(HTTP.CODE_NOT_MODIFIED, HTTP.STATUS_NOT_MODIFIED);
               }
            }
         }
View Full Code Here


         boolean browserClient = handler instanceof RESTHandler && endpoint instanceof HTTPServerBase;

         // Yank some request headers from the client and pass them through
         if ( browserClient ) {
            Request request = context.getRequest();

            for ( int i = 0; i < PASSTHRU_REQUEST_HEADERS.length; i++ ) {
               String key = PASSTHRU_REQUEST_HEADERS[i];
               String value = request.getHeader(key);
               if ( value != null && value.length() > 0 ) {
                  if ( key == HTTP.HEADER_IF_MODIFIED_SINCE )
                     modSince = value;
                  else
                     conn.setRequestProperty(key, value);
View Full Code Here

TOP

Related Classes of com.dbxml.labrador.Request

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.