Package org.apache.oodt.cas.product.jaxrs.exceptions

Examples of org.apache.oodt.cas.product.jaxrs.exceptions.BadRequestException


      if (!file.exists() || file.isDirectory())
      {
        String message =
          "Could not locate the reference source file(s) in the data store.";
        LOGGER.log(Level.FINE, message);
        throw new BadRequestException(message);
      }

      httpHeaders.add("Content-Type", contentType);
      httpHeaders.add("Content-Disposition",
        "attachment; filename=\"" + file.getName() + "\"");
View Full Code Here


      // Retrieve the reference file.
      Reference reference = resource.getReference();
      File refFile = new File(new URI(reference.getDataStoreReference()));
      if (!refFile.exists())
      {
        throw new BadRequestException("Unable to locate the source file for the"
          + " reference.");
      }

      // Try to remove previously created zip files that have the same name.
      String workingDirPath = workingDir.getCanonicalPath();
View Full Code Here

    @QueryParam("productId") String productId,
    @QueryParam("refIndex") int refIndex)
  {
    if (productId == null || productId.trim().equals(""))
    {
      throw new BadRequestException("This URL requires a productId query "
        + "parameter with a product ID value, "
        + "e.g. /reference?productId=1787a257-df87-11e2-8a2d-e3f6264e86c5");
    }

    try
View Full Code Here

    "application/rdf+xml", "application/rss+xml", "application/zip"})
  public ProductResource getProduct(@QueryParam("productId") String productId)
  {
    if (productId == null || productId.trim().equals(""))
    {
      throw new BadRequestException("This URL requires a productId query "
        + "parameter with a product ID value, "
        + "e.g. /product?productId=1787a257-df87-11e2-8a2d-e3f6264e86c5");
    }

    try
View Full Code Here

  public DatasetResource getDataset(
    @QueryParam("productTypeId") String productTypeId)
  {
    if (productTypeId == null || productTypeId.trim().equals(""))
    {
      throw new BadRequestException("This URL requires a productTypeId query "
        + "parameter and either a product type ID value or 'ALL' for all "
        + "product types.");
    }

    try
View Full Code Here

  public TransferResource getTransfer(
    @QueryParam("dataStoreRef") String dataStoreRef)
  {
    if (dataStoreRef == null || dataStoreRef.trim().equals(""))
    {
      throw new BadRequestException("This URL requires a dataStoreRef query "
        + "parameter and a data store reference value, "
        + "e.g. /transfer?dataStoreRef=file:/repository/test.txt/test.txt");
    }

    try
View Full Code Here

  public TransfersResource getTransfers(
    @QueryParam("productId") String productId)
  {
    if (productId == null || productId.trim().equals(""))
    {
      throw new BadRequestException("This URL requires a productId query "
        + "parameter and either a valid product ID value or 'ALL' for all "
        + "products.");
    }

    try
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.product.jaxrs.exceptions.BadRequestException

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.