Examples of ResourceType


Examples of com.adito.policyframework.ResourceType

     * @return int the unique priority
     * @throws Exception
     */
    public static int getAuthenticationSchemePriority(SessionInfo session) throws Exception {
        User user = session.getUser();
        ResourceType resourceType = PolicyConstants.AUTHENTICATION_SCHEMES_RESOURCE_TYPE;
        List<Integer> granted = PolicyDatabaseFactory.getInstance().getGrantedResourcesOfType(user, resourceType);

        List<AuthenticationScheme> schemes = new ArrayList<AuthenticationScheme>();
        for (Integer resourceId : granted) {
            AuthenticationScheme scheme = (AuthenticationScheme) resourceType.getResourceById(resourceId.intValue());
            schemes.add(scheme);
        }
        Collections.sort(schemes, new Comparator<AuthenticationScheme>() {
            public int compare(AuthenticationScheme o1, AuthenticationScheme o2) {
                return Math.abs(o1.getPriorityInt()) - Math.abs(o2.getPriorityInt());
View Full Code Here

Examples of com.android.resources.ResourceType

                                        + "letters and digits ([a-z0-9_.])";
                                throw new MergingException(message).setFile(file);
                            }
                        }

                        ResourceType itemType = item.getType();
                        String folderName = itemType.getName();
                        String qualifiers = resourceFile.getQualifiers();
                        if (!qualifiers.isEmpty()) {
                            folderName = folderName + RES_QUALIFIER_SEP + qualifiers;
                        }
View Full Code Here

Examples of com.cloud.agent.api.storage.DownloadCommand.ResourceType

     */
    private String postDownload(String jobId) {
        DownloadJob dnld = jobs.get(jobId);
        TemplateDownloader td = dnld.getTemplateDownloader();
        String resourcePath = null;              
        ResourceType resourceType = dnld.getResourceType();
      
        // once template path is set, remove the parent dir so that the template is installed with a relative path
        String finalResourcePath = "";
        if (resourceType == ResourceType.TEMPLATE){
          finalResourcePath += _templateDir + File.separator + dnld.getAccountId() + File.separator + dnld.getId() + File.separator;
View Full Code Here

Examples of com.cloud.configuration.Resource.ResourceType

                }
            }
        }

        // Map resource type
        ResourceType resourceType = null;
        if (type != null) {
            try {
                resourceType = ResourceType.values()[type];
            } catch (ArrayIndexOutOfBoundsException e) {
                throw new InvalidParameterValueException("Please specify a valid resource type.");
View Full Code Here

Examples of com.github.sardine.model.Resourcetype

    HttpPropFind entity = new HttpPropFind(url);
    entity.setDepth("1");
    Propfind body = new Propfind();
    Prop prop = new Prop();
    prop.setDisplayname(new Displayname());
    prop.setResourcetype(new Resourcetype());
    prop.setPrincipalURL(new PrincipalURL());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
View Full Code Here

Examples of com.googlecode.sardine.model.Resourcetype

      return null;
    }
    for (Propstat propstat : list)
    {
      if (propstat.getProp() != null) {
        Resourcetype resourcetype = propstat.getProp().getResourcetype();
        if ((resourcetype != null) && (resourcetype.getCollection() != null))
        {
          // Need to correct the contentType to identify as a directory.
          return HTTPD_UNIX_DIRECTORY_CONTENT_TYPE;
        }
        else
View Full Code Here

Examples of com.jeecms.common.fck.ResourceType

    out.close();
  }

  private UploadResponse doUpload(HttpServletRequest request, String typeStr,
      String currentFolderStr, Boolean mark) throws Exception {
    ResourceType type = ResourceType.getDefaultResourceType(typeStr);
    try {
      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
      // We upload just one file at the same time
      MultipartFile uplFile = multipartRequest.getFileMap().entrySet()
          .iterator().next().getValue();
      CmsUser user = CmsUtils.getUser(request);
      int fileSize = (int) (uplFile.getSize() / 1024);
      // 文件太大,不允许上传
      if (!user.isAllowMaxFile(fileSize)) {
        log.warn("member fck upload warn: not allow max file: {}",
            fileSize);
        return UploadResponse.getFileUploadDisabledError(request);
      }
      // 文件上传今日额度已经用完
      if (!user.isAllowPerDay(fileSize)) {
        log.warn("member fck upload warn: not allow per day: {}",
            fileSize);
        return UploadResponse.getFileUploadDisabledError(request);
      }
      // Some browsers transfer the entire source path not just the
      // filename
      String filename = FilenameUtils.getName(uplFile
          .getOriginalFilename());
      log.debug("Parameter NewFile: {}", filename);
      String ext = FilenameUtils.getExtension(filename);
      // 不允许上传的文件后缀
      if (!user.isAllowSuffix(ext)) {
        log.warn("member fck upload warn:"
            + " not allow file extension: {}", ext);
        return UploadResponse.getFileUploadDisabledError(request);
      }
      if (type.isDeniedExtension(ext)) {
        return UploadResponse.getInvalidFileTypeError(request);
      }
      if (type.equals(ResourceType.IMAGE)
          && !ImageUtils.isImage(uplFile.getInputStream())) {
        return UploadResponse.getInvalidFileTypeError(request);
      }
      String fileUrl;
      CmsSite site = CmsUtils.getSite(request);
      MarkConfig conf = site.getConfig().getMarkConfig();
      if (mark == null) {
        mark = conf.getOn();
      }
      boolean isImg = type.equals(ResourceType.IMAGE);
      if (site.getConfig().getUploadToDb()) {
        if (mark && isImg) {
          File tempFile = mark(uplFile, conf);
          fileUrl = dbFileMng.storeByExt(site.getUploadPath(), ext,
              new FileInputStream(tempFile));
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceType

    expectedTypes.put("com.linkedin.restli.examples.scala.client.scalaGreetings", ResourceType.COLLECTION);

    for (Map.Entry<String, ResourceSchema> entry: _schemas.getResources().entrySet())
    {
      final ResourceSchema schema = entry.getValue();
      final ResourceType actualType;
      if (schema.hasCollection())
      {
        actualType = ResourceType.COLLECTION;
      }
      else if (schema.hasAssociation())
      {
        actualType = ResourceType.ASSOCIATION;
      }
      else if (schema.hasSimple())
      {
        actualType = ResourceType.SIMPLE;
      }
      else
      {
        Assert.assertTrue(schema.hasActionsSet());
        actualType = ResourceType.ACTIONS;
      }

      final String schemaFullName = getResourceSchemaFullName(schema, entry.getKey());
      final ResourceType expectedType = expectedTypes.get(schemaFullName);
      Assert.assertNotNull(expectedType);
      Assert.assertSame(actualType, expectedType, schemaFullName);
    }
  }
View Full Code Here

Examples of com.netflix.simianarmy.ResourceType

                        summaryEmailTarget));
                return;
            }
            StringBuilder message = new StringBuilder();
            for (AbstractJanitor janitor : janitors) {
                ResourceType resourceType = janitor.getResourceType();
                appendSummary(message, "markings", resourceType, janitor.getMarkedResources(), janitor.getRegion());
                appendSummary(message, "unmarkings", resourceType, janitor.getUnmarkedResources(), janitor.getRegion());
                appendSummary(message, "cleanups", resourceType, janitor.getCleanedResources(), janitor.getRegion());
                appendSummary(message, "cleanup failures", resourceType, janitor.getFailedToCleanResources(),
                        janitor.getRegion());
View Full Code Here

Examples of com.skyline.base.type.ResourceType

      if (commentType.equals(CommentType.SHARE)) {
        LOGGER.debug("评论分享:" + resourceId);
        shareDao.updateCommentNumAdd(resourceId);
      } else {
        try {
          ResourceType resourceType = ResourceType.valueOf(commentType.toString());
          if (resourceType != null) {
            resourceDao.updateCommentNumAdd(resourceType, resourceId);
          }
        } catch (Exception e) {
          LOGGER.warn("", 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.