Examples of DataChunk


Examples of com.google.ytd.model.DataChunk

      query.setFilter("photoEntryId == photoEntryIdParam && index == indexParam");
      query.declareParameters("String photoEntryIdParam, int indexParam");

      List<DataChunk> results = (List<DataChunk>) query.execute(photoEntryId, index);
      if (results.size() > 0) {
        DataChunk dataChunk = results.get(0);
        bytes = dataChunk.getData();

        int startIndex = (int) startByte - (index * DataChunk.CHUNK_SIZE);
        if (startIndex != 0) {
          bytes = Arrays.copyOfRange(bytes, startIndex, bytes.length);
        }
View Full Code Here

Examples of com.google.ytd.model.DataChunk

            if (bytesRead < DataChunk.CHUNK_SIZE) {
              buffer = Arrays.copyOf(buffer, bytesRead);
            }
           
            DataChunk chunk = new DataChunk(photoEntry.getId(), index, buffer);
            pmfUtil.persistJdo(chunk);
            index++;
          }
         
          photoEntry.setOriginalFileSize(fileSize);
View Full Code Here

Examples of net.sourceforge.jrrd.DataChunk

public class SimpleFetch1 {

  public SimpleFetch1(String rrdFile) {
    RRDatabase rrd = null;
    DataChunk chunk = null;
    try {
      rrd = new RRDatabase(rrdFile);
      // no period specified, so request the last 24 hours
      chunk = rrd.getData(ConsolidationFunctionType.AVERAGE);
      // retrieve the data for the first datasource
      Map<Date, Double> values = chunk.toMap(0);
            for(Map.Entry<Date, Double> entry : values.entrySet()) {
                Date index = entry.getKey();
                double v = entry.getValue();
                System.out.println("index: <" + index + ">, value <" + v + ">");
            }
View Full Code Here

Examples of org.glassfish.grizzly.http.util.DataChunk

   
    @Override
    public void service(final Request request, final Response response)
            throws Exception {
        // don't decode and avoid creating a string
        final DataChunk requestURIBC = request.getRequest()
                .getRequestURIRef().getRequestURIBC();
       
        if (requestURIBC.equals("/json")) {
            jsonHandler.service(request, response);
        } else {
            plainTextHandler.service(request, response);
        }
    }
View Full Code Here

Examples of org.glassfish.grizzly.http.util.DataChunk

                    httpHandler.service(request, response);
                    return;
                }
            }

            final DataChunk decodedURI = request.getRequest()
                    .getRequestURIRef().getDecodedRequestURIBC(isAllowEncodedSlash());

            mappingData = request.getNote(MAPPING_DATA);
            if (mappingData == null) {
                mappingData = new MappingData();
                request.setNote(MAPPING_DATA, mappingData);
            } else {
                mappingData.recycle();
            }
            HttpHandler httpService;

            final CharChunk decodedURICC = decodedURI.getCharChunk();
            final int semicolon = decodedURICC.indexOf(';', 0);

            // Map the request without any trailling.
            httpService = mapUriWithSemicolon(request, decodedURI, semicolon, mappingData);
            if (httpService == null || httpService instanceof ContainerMapper) {
                String ext = decodedURI.toString();
                String type = "";
                if (ext.lastIndexOf(".") > 0) {
                    ext = "*" + ext.substring(ext.lastIndexOf("."));
                    type = ext.substring(ext.lastIndexOf(".") + 1);
                }

                if (!MimeType.contains(type) && !"/".equals(ext)) {
                    initializeFileURLPattern(ext);
                    mappingData.recycle();
                    httpService = mapUriWithSemicolon(request, decodedURI, semicolon, mappingData);
                } else {
                    super.service(request, response);
                    return;
                }
            }

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE, "Request: {0} was mapped to Adapter: {1}",
                        new Object[]{decodedURI.toString(), httpService});
            }

            // The Adapter used for servicing static pages doesn't decode the
            // request by default, hence do not pass the undecoded request.
            if (httpService == null || httpService instanceof ContainerMapper) {
View Full Code Here

Examples of org.glassfish.grizzly.http.util.DataChunk

        if (semicolonPos == 0) {
            semicolonPos = decodedURI.indexOf(';', 0);
        }

        DataChunk localDecodedURI = decodedURI;
        if (semicolonPos >= 0) {
            charChunk.setEnd(semicolonPos);
            // duplicate the URI path, because Mapper may corrupt the attributes,
            // which follow the path
            localDecodedURI = req.getNote(DATA_CHUNK);
            if (localDecodedURI == null) {
                localDecodedURI = DataChunk.newInstance();
                req.setNote(DATA_CHUNK, localDecodedURI);
            }
            localDecodedURI.duplicate(decodedURI);
        }


        try {
            return map(req, localDecodedURI, mappingData);
View Full Code Here

Examples of org.glassfish.grizzly.http.util.DataChunk

                    return new HttpHandlerCallable(httpHandler,
                            request, response);
                }
            }

            final DataChunk decodedURI = request.getRequest()
                    .getRequestURIRef().getDecodedRequestURIBC(isAllowEncodedSlash());

            mappingData = request.getNote(MAPPING_DATA);
            if (mappingData == null) {
                mappingData = new MappingData();
                request.setNote(MAPPING_DATA, mappingData);
            } else {
                mappingData.recycle();
            }
            HttpHandler httpHandler;

            final CharChunk decodedURICC = decodedURI.getCharChunk();
            final int semicolon = decodedURICC.indexOf(';', 0);

            // Map the request without any trailling.
            httpHandler = mapUriWithSemicolon(request, decodedURI,
                    semicolon, mappingData);
            if (httpHandler == null || httpHandler instanceof ContainerMapper) {
                String ext = decodedURI.toString();
                String type = "";
                if (ext.lastIndexOf(".") > 0) {
                    ext = "*" + ext.substring(ext.lastIndexOf("."));
                    type = ext.substring(ext.lastIndexOf(".") + 1);
                }

                if (!MimeType.contains(type) && !"/".equals(ext)) {
                    initializeFileURLPattern(ext);
                    mappingData.recycle();
                    httpHandler = mapUriWithSemicolon(request, decodedURI,
                            semicolon, mappingData);
                } else {
//                    super.service(request, response);
//                    return;
                    return new SuperCallable(request, response);
                }
            }

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE, "Request: {0} was mapped to Adapter: {1}",
                        new Object[]{decodedURI.toString(), httpHandler});
            }

            // The Adapter used for servicing static pages doesn't decode the
            // request by default, hence do not pass the undecoded request.
            if (httpHandler == null || httpHandler instanceof ContainerMapper) {
View Full Code Here

Examples of org.glassfish.grizzly.http.util.DataChunk

            if (semicolonPos == 0) {
                semicolonPos = decodedURI.indexOf(';', 0);
            }

            DataChunk localDecodedURI = decodedURI;
            if (semicolonPos >= 0) {
                charChunk.setEnd(semicolonPos);
                // duplicate the URI path, because Mapper may corrupt the attributes,
                // which follow the path
                localDecodedURI = req.getNote(DATA_CHUNK);
                if (localDecodedURI == null) {
                    localDecodedURI = DataChunk.newInstance();
                    req.setNote(DATA_CHUNK, localDecodedURI);
                }
                localDecodedURI.duplicate(decodedURI);
            }


            try {
                return map(req, localDecodedURI, mappingData);
View Full Code Here

Examples of org.glassfish.grizzly.http.util.DataChunk

     */
    private void removeParameterFromRequestURI(String parameter) {

        int semicolon, semicolon2;

        final DataChunk uriBC =
                coyoteRequest.getRequest().getRequestURIRef().getRequestURIBC();
       
//        start = uriBC.getStart();
//        end = uriBC.getEnd();
        semicolon = uriBC.indexOf(parameter, 0);

        if (semicolon > 0) {
            semicolon2 = uriBC.indexOf(';', semicolon + parameter.length());

            final int end;
            if (semicolon2 >= 0) {
                end = semicolon2;
                uriBC.notifyDirectUpdate();
            } else {
                end = uriBC.getLength();
            }
           
            uriBC.delete(semicolon, end);
//            uriBC.setEnd(start + semicolon);
//            byte[] buf = uriBC.getBuffer();
//            if (semicolon2 >= 0) {
//                for (int i = 0; i < end - start - semicolon2; i++) {
//                    buf[start + semicolon + i] = buf[start + i + semicolon2];
View Full Code Here

Examples of org.glassfish.grizzly.http.util.DataChunk

        String defaultVS = listener.findHttpProtocol().getHttp().getDefaultVirtualServer();
        if (!defaultVS.equals(org.glassfish.api.web.Constants.ADMIN_VS)) {
            // Before we start a WebConnector, let's makes sure there is
            // not another Container already listening on that port
            DataChunk host = DataChunk.newInstance();
            char[] c = defaultVS.toCharArray();
            host.setChars(c, 0, c.length);

            DataChunk mb = DataChunk.newInstance();
            mb.setChars(new char[]{'/'}, 0, 1);

            MappingData md = new MappingData();
            try {
                mapper.map(host, mb, md);
            } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.