Examples of LargeResult


Examples of org.apache.oodt.xmlquery.LargeResult

    }

    private LargeResult toResult(Reference r) throws URISyntaxException {
        String mimeType = r.getMimeType() != null ? r.getMimeType().getName()
                : DataUtils.guessTypeFromName(r.getDataStoreReference());
        LargeResult result = new LargeResult(r.getDataStoreReference(),
                mimeType, CAS_PROFILE_ID, new File(new URI(r
                        .getDataStoreReference())).getName(),
                Collections.singletonList(new Header(FILE_HEADER, mimeType,
                        null /* unit */)), r.getFileSize());
        return result;
View Full Code Here

Examples of org.apache.oodt.xmlquery.LargeResult

   * @throws IOException if an error occurs.
   */
  private void deliverResult(QueryHandler handler, Result result, HttpServletResponse res) throws IOException {
    characterize(handler, result, res);                 // First, describe it using HTTP headers
    if (result instanceof LargeResult) {               // Is it a large result?
      LargeResult lr = (LargeResult) result;             // Yes, this is gonna take some special work
      LargeProductQueryHandler lpqh = (LargeProductQueryHandler) handler; // First treat 'em as large
      ProductRetriever retriever = new ProductRetriever(lpqh);       // Large ones need a retriever
      lr.setRetriever(retriever);               // Set the retriever
    }
    BufferedInputStream in = null;                 // Start with no input stream
    try {                       // Then try ...
      in = new BufferedInputStream(result.getInputStream());         // To open the input stream
      byte[] buf = new byte[512];               // And a byte buffer for data
View Full Code Here

Examples of org.apache.oodt.xmlquery.LargeResult

      } else { // use default mimetype of product on disk
        mimeType = MimeTypesFactory.create().getMimeType(new File(realPath)).getName();
      }
     
      xmlQuery.getResults().add(
          new LargeResult(/* id */rtAndPath,/* mimeType */ mimeType, /* profileID */null,
              /* resourceID */new File(realPath).getName(), Collections.EMPTY_LIST,
              handler.sizeOf(realPath)));
    } else {
      throw new ProductException("return type: [" + cmd + "] is unsupported!");
    }
View Full Code Here

Examples of org.apache.oodt.xmlquery.LargeResult

   * @throws IOException if an error occurs.
   */
  private void deliverResult(QueryHandler handler, Result result, HttpServletResponse res) throws IOException {
    characterize(result, res);                 // First, describe it using HTTP headers
    if (result instanceof LargeResult) {               // Is it a large result?
      LargeResult lr = (LargeResult) result;             // Yes, this is gonna take some special work
      LargeProductQueryHandler lpqh = (LargeProductQueryHandler) handler; // First treat 'em as large
      ProductRetriever retriever = new ProductRetriever(lpqh);       // Large ones need a retriever
      lr.setRetriever(retriever);               // Set the retriever
    }
    BufferedInputStream in = null;                 // Start with no input stream
    try {                       // Then try ...
      in = new BufferedInputStream(result.getInputStream());         // To open the input stream
      byte[] buf = new byte[512];               // And a byte buffer for data
View Full Code Here

Examples of org.apache.oodt.xmlquery.LargeResult

    } else if (isGetCmd(cmd)) {
      OFSNGetHandler handler = getGetHandler(cmd, cfg.getClassName());
      String rtAndPath = cmd + CMD_SEPARATOR + realPath;

      xmlQuery.getResults().add(
          new LargeResult(/* id */rtAndPath,/* mimeType */
          MimeTypesFactory.create().getMimeType(new File(realPath)).getName(), /* profileID */
          null, /* resourceID */new File(realPath).getName(),
              Collections.EMPTY_LIST, handler.sizeOf(realPath)));
    } else {
      throw new ProductException("return type: [" + cmd + "] is unsupported!");
View Full Code Here

Examples of org.apache.oodt.xmlquery.LargeResult

      } else { // use default mimetype of product on disk
        mimeType = MimeTypesFactory.create().getMimeType(new File(realPath)).getName();
      }
     
      xmlQuery.getResults().add(
          new LargeResult(/* id */rtAndPath,/* mimeType */ mimeType, /* profileID */null,
              /* resourceID */new File(realPath).getName(), Collections.EMPTY_LIST,
              handler.sizeOf(realPath)));
    } else {
      throw new ProductException("return type: [" + cmd + "] is unsupported!");
    }
View Full Code Here

Examples of org.apache.oodt.xmlquery.LargeResult

   * @throws IOException if an error occurs.
   */
  private void deliverResult(QueryHandler handler, Result result, HttpServletResponse res) throws IOException {
    characterize(result, res);                 // First, describe it using HTTP headers
    if (result instanceof LargeResult) {               // Is it a large result?
      LargeResult lr = (LargeResult) result;             // Yes, this is gonna take some special work
      LargeProductQueryHandler lpqh = (LargeProductQueryHandler) handler; // First treat 'em as large
      ProductRetriever retriever = new ProductRetriever(lpqh);       // Large ones need a retriever
      lr.setRetriever(retriever);               // Set the retriever
    }
    BufferedInputStream in = null;                 // Start with no input stream
    try {                       // Then try ...
      in = new BufferedInputStream(result.getInputStream());         // To open the input stream
      byte[] buf = new byte[512];               // And a byte buffer for data
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.