当前位置: 首页>>代码示例>>Java>>正文


Java ClassLoaderUtils类代码示例

本文整理汇总了Java中com.atlassian.core.util.ClassLoaderUtils的典型用法代码示例。如果您正苦于以下问题:Java ClassLoaderUtils类的具体用法?Java ClassLoaderUtils怎么用?Java ClassLoaderUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClassLoaderUtils类属于com.atlassian.core.util包,在下文中一共展示了ClassLoaderUtils类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTransformerUrlFromConfigFile

import com.atlassian.core.util.ClassLoaderUtils; //导入依赖的package包/类
private String getTransformerUrlFromConfigFile() {
    InputStream properties = ClassLoaderUtils.getResourceAsStream("autodoc_confluence.properties", getClass());
    Properties props = new Properties();
    try {
        props.load(properties);
    } catch (IOException e) {
        log.error("Couldn't load the configuration file", e);
    }
    return props.getProperty("transformerUrl", "https://localhost:8080/transformer");
}
 
开发者ID:NetworkedAssets,项目名称:doc,代码行数:11,代码来源:DocSettingsService.java

示例2: populateI18nProperties

import com.atlassian.core.util.ClassLoaderUtils; //导入依赖的package包/类
private void populateI18nProperties() {
    try (final InputStream stream = ClassLoaderUtils.getResourceAsStream(HubJiraConstants.PROPERTY_FILENAME, this.getClass())) {
        if (stream != null) {
            i18nProperties.load(stream);
        } else {
            logger.warn("Error opening property file: " + HubJiraConstants.PROPERTY_FILENAME);
        }
    } catch (final IOException e) {
        logger.warn("Error reading property file: " + HubJiraConstants.PROPERTY_FILENAME);
    }
    logger.debug("i18nProperties: " + i18nProperties);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:13,代码来源:HubJiraConfigController.java

示例3: getWorkflowDescriptorFromResource

import com.atlassian.core.util.ClassLoaderUtils; //导入依赖的package包/类
private WorkflowDescriptor getWorkflowDescriptorFromResource() throws IOException, FactoryException {
    // https://developer.atlassian.com/confdev/development-resources/confluence-developer-faq/what-is-the-best-way-to-load-a-class-or-resource-from-a-plugin
    final InputStream inputStream = ClassLoaderUtils
            .getResourceAsStream(HubJiraConstants.HUB_JIRA_WORKFLOW_RESOURCE, this.getClass());
    if (inputStream == null) {
        logger.error("Could not find the Hub JIRA workflow resource.");
        settingService.addHubError("Could not find the Hub JIRA workflow resource.", "addHubWorkflow");
        return null;
    }
    final String workflowXml = IOUtils.toString(inputStream, StandardCharsets.UTF_8.name());

    return WorkflowUtil.convertXMLtoWorkflowDescriptor(workflowXml);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:14,代码来源:HubWorkflowSetup.java

示例4: createBlackDuckAvatar

import com.atlassian.core.util.ClassLoaderUtils; //导入依赖的package包/类
private Avatar createBlackDuckAvatar(String issueTypeName) throws DataAccessException, IOException {
    logger.debug("Creating avatar for issue type: " + issueTypeName);

    String avatarImagePath = getAvatarImagePath(issueTypeName);
    String avatarImageFilename = getAvatarImageFilename(issueTypeName);

    logger.debug("Loading Black Duck avatar from " + avatarImagePath);

    logger.debug("Creating avatar template");
    final Avatar avatarTemplate = jiraServices.createIssueTypeAvatarTemplate(
            avatarImageFilename,
            "image/png", jiraUser.getKey());
    if (avatarTemplate == null) {
        logger.debug("jiraServices.createIssueTypeAvatarTemplate() returned null");
        return null;
    }

    InputStream is = ClassLoaderUtils.getResourceAsStream(avatarImagePath, this.getClass());
    final Avatar duckyAvatar = jiraServices.getAvatarManager().create(avatarTemplate,
            is, null);

    if (duckyAvatar == null) {
        throw new DataAccessException("AvatarManager().create() returned null");
    }
    logger.debug("Created Avatar " + duckyAvatar.getFileName() + " with ID " + duckyAvatar.getId());
    return duckyAvatar;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:28,代码来源:HubAvatars.java


注:本文中的com.atlassian.core.util.ClassLoaderUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。