Package org.apache.oodt.product

Examples of org.apache.oodt.product.ProductException


   * org.apache.oodt.product.handlers.ofsn.OFSNListHandler#getListing(java
   * .lang.String)
   */
  public File[] getListing(String ofsn) throws ProductException {
    if (!new File(ofsn).exists()) {
      throw new ProductException("file: [" + ofsn + "] does not exist!");
    }

    String zipFilePath = this.cacheRoot + new File(ofsn).getName() + ".zip";
    File zipFile = OFSNUtils.buildZipFile(zipFilePath, new File[] { new File(
        ofsn) });
View Full Code Here


          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!");
    }

    return xmlQuery;

  }
View Full Code Here

  }

  private void validate(String ofsn, String cmd) throws ProductException {
    if (ofsn == null || cmd == null || (ofsn != null && ofsn.equals(""))
        || (cmd != null && cmd.equals(""))) {
      throw new ProductException("must specify OFSN and RT parameters!");
    }
  }
View Full Code Here

  }

  private void validateHandlerConfig(OFSNHandlerConfig cfg, String cmd)
      throws ProductException {
    if (cfg == null) {
      throw new ProductException("Unrecognized command: [" + cmd + "]!");
    }
  }
View Full Code Here

  }

  private boolean isListingCmd(String cmd) throws ProductException {
    OFSNHandlerConfig cfg = this.conf.getHandlerConfig(cmd);
    if (cfg == null) {
      throw new ProductException("Unrecognized command: [" + cmd + "]!");
    }

    if (cfg.getType().equals(LISTING_CMD)) {
      return true;
    } else
View Full Code Here

  /* (non-Javadoc)
   * @see org.apache.oodt.product.handlers.ofsn.OFSNListHandler#getListing(java.lang.String)
   */
  public File[] getListing(String ofsn) throws ProductException {
    if (!new File(ofsn).exists()) {
          throw new ProductException("file: [" + ofsn
                  + "] does not exist!");
      }
      return new File[] { new File(ofsn) };
  }
View Full Code Here

      buf = new byte[length];
      int numRead;
      long numSkipped;
      numSkipped = in.skip(offset);
      if (numSkipped != offset) {
        throw new ProductException("Was not able to skip: [" + offset
            + "] bytes into product: num actually skipped: [" + numSkipped
            + "]");
      }

      numRead = in.read(buf, 0, length);

      if (numRead != length) {
        throw new ProductException("Was not able to read: [" + length
            + "] bytes from product: num actually read: [" + numRead + "]");
      }
    } catch (IOException e) {
      e.printStackTrace();
      throw new ProductException("IO exception retrieving chunk of product: ["
          + filepath + "]: Message: " + e.getMessage());
    } finally {
      if (in != null) {
        try {
          in.close();
View Full Code Here

      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!");
    }

    return xmlQuery;

  }
View Full Code Here

  }

  private void validate(String ofsn, String cmd) throws ProductException {
    if (ofsn == null || cmd == null || (ofsn != null && ofsn.equals(""))
        || (cmd != null && cmd.equals(""))) {
      throw new ProductException("must specify OFSN and RT parameters!");
    }
  }
View Full Code Here

  }

  private void validateHandlerConfig(OFSNHandlerConfig cfg, String cmd)
      throws ProductException {
    if (cfg == null) {
      throw new ProductException("Unrecognized command: [" + cmd + "]!");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.oodt.product.ProductException

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.