Examples of GadgetException


Examples of org.apache.shindig.gadgets.GadgetException

    if (!problems.isEmpty()) {
      StringBuilder sb = new StringBuilder();
      sb.append("Problems found processing features:\n");
      Joiner.on('\n').appendTo(sb, problems);
      throw new GadgetException(GadgetException.Code.INVALID_CONFIG, sb.toString());
    }
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.GadgetException

        String content = resourceLoader.getResourceContent(resource);
        Uri parent = new UriBuilder().setScheme(RESOURCE_SCHEME).setPath(resource).toUri();
        loadFeature(parent, content, featureMapBuilder);
      }
    } catch (IOException e) {
      throw new GadgetException(GadgetException.Code.INVALID_PATH, e);
    }
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.GadgetException

  }

  private void loadFile(FeatureFile file, Map<String,FeatureNode> featureMapBuilder)
      throws GadgetException, IOException {
    if (!file.exists() || !file.canRead()) {
      throw new GadgetException(GadgetException.Code.INVALID_CONFIG,
          "Feature file '" + file.getPath() + "' doesn't exist or can't be read");
    }

    FeatureFile[] toLoad = file.isDirectory() ? file.listFiles() : new FeatureFile[] { file };
View Full Code Here

Examples of org.apache.shindig.gadgets.GadgetException

      while (!toTraverse.isEmpty()) {
        Pair<FeatureNode, Pair<Integer, String>> next = toTraverse.poll();
        String debug = next.two.two + (next.two.one > 0 ? " -> " : "") + next.one.name;
        if (next.one == this && next.two.one != 0) {
          throw new GadgetException(GadgetException.Code.INVALID_CONFIG,
              "Feature dep loop detected: " + debug);
        }
        // Breadth-first list of dependencies.
        this.transitiveDeps.add(next.one);
        this.nodeDepth = Math.max(this.nodeDepth, next.two.one);
View Full Code Here

Examples of org.apache.shindig.gadgets.GadgetException

      } else if ("res".equals(uri.getScheme())) {
        return loadResource(uri.getPath(), attribs);
      }
      return loadUri(uri, attribs);
    } catch (IOException e) {
      throw new GadgetException(GadgetException.Code.FAILED_TO_RETRIEVE_CONTENT, e);
    }
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.GadgetException

        .setContainer(getContainer());
    if (!Strings.isNullOrEmpty(getGadget())) {
      try {
        req.setGadget(Uri.parse(getGadget()));
      } catch (IllegalArgumentException e) {
        throw new GadgetException(GadgetException.Code.INVALID_PARAMETER,
            "Invalid " + Param.GADGET.getKey() + " param: " + getGadget(),
            HttpResponse.SC_BAD_REQUEST);
      }
    }
    if (getRefresh() != null && getRefresh() >= 0) {
View Full Code Here

Examples of org.apache.shindig.gadgets.GadgetException

      break;
    case INVALID_VERSION:
      retRefresh = 0;
      break;
    case BAD_URI:
      throw new GadgetException(GadgetException.Code.INVALID_PATH,
          "Invalid path", HttpResponse.SC_BAD_REQUEST);
    default:
      // Should never happen.
      throw new GadgetException(GadgetException.Code.INTERNAL_SERVER_ERROR,
          "Unknown status: " + getStatus());
    }
    Integer setVal = getRefresh();
    if (setVal != null) {
      // Override always wins.
View Full Code Here

Examples of org.apache.shindig.gadgets.GadgetException

      }
      try {
        // Doing delay parsing.
        return Uri.parse(fallbackUrl);
      } catch (IllegalArgumentException e) {
        throw new GadgetException(GadgetException.Code.INVALID_PARAMETER,
            Param.FALLBACK_URL_PARAM.getKey() + " param is invalid: "
            + e, HttpResponse.SC_BAD_REQUEST);
      }
    }
View Full Code Here

Examples of org.apache.shindig.gadgets.GadgetException

    public HttpResponse fetch(HttpRequest request) throws GadgetException {
      fetchCount++;
      this.request = request;
      if (response == null) {
        throw new GadgetException(GadgetException.Code.FAILED_TO_RETRIEVE_CONTENT);
      }
      return response;
    }
View Full Code Here

Examples of org.apache.shindig.gadgets.GadgetException

    FeatureRegistry featureRegistry = featureRegistryProvider.get(repository);

    checkRequiredFeatures(gadget, featureRegistry);
    //Check to make sure all the required features that are about to be injected are allowed
    if(!gadgetAdminStore.checkFeatureAdminInfo(gadget)) {
      throw new GadgetException(Code.GADGET_ADMIN_FEATURE_NOT_ALLOWED);
    }

    // Set of extern libraries requested by the container
    Set<String> externForcedLibs = defaultExternLibs;
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.