com.atlassian.plugin.Plugin.getResource()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(220)

本文整理了Java中com.atlassian.plugin.Plugin.getResource()方法的一些代码示例,展示了Plugin.getResource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.getResource()方法的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
方法名:getResource

Plugin.getResource介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-schema-plugin

@Override
public URL getResource(final String path)
{
  return plugin.getResource(path);
}

代码示例来源:origin: com.atlassian.plugins.rest/atlassian-rest-module

private static boolean resourcesAvailable(Plugin plugin, String... resources) {
    for (final String resource : resources) {
      if (plugin.getResource(resource) == null) {
        return false;
      }
    }
    return true;
  }
}

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core

@Override
public URL getResource(final String path) {
  return plugin.getResource(path);
}

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-schema

@Override
public URL getResource(final String path) {
  return plugin.getResource(path);
}

代码示例来源:origin: com.atlassian.jira/jira-core

private URL getIconUrl(Plugin plugin)
  {
    if (iconPath == null)
    {
      return null;
    }

    URL url = plugin.getResource(iconPath);
    if (url == null)
    {
      throw new IllegalArgumentException("Icon for issue type '" + key + "'not found on path specified: " + iconPath);
    }

    return url;
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
  public Option<URL> getResource(final Plugin plugin, final String resourcePath)
  {
    return Option.option(plugin.getResource(resourcePath));
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

private URL getBundleURL(Plugin plugin)
  {
    URL url = plugin.getResource(bundlePath());
    if (url == null)
    {
      throw new IllegalArgumentException("Workflow bundle for workflow '" + name + "'not found on path specified: " + bundlePath);
    }

    return url;
  }
}

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-core

private URL getShallowSchemaUrl() {
    return pluginRetrievalService.getPlugin().getResource("/schema/shallow-schema.json");
  }
}

代码示例来源:origin: com.atlassian.plugins/remotable-plugins-servlet-kit

protected boolean hasResource(String path)
{
  return pluginRetrievalService.getPlugin().getResource(path) != null;
}

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-core

private URL getShallowSchemaUrl() {
    return pluginRetrievalService.getPlugin().getResource("/schema/shallow-schema.json");
  }
}

代码示例来源:origin: com.atlassian.pluginkit/servlet-kit

protected boolean hasResource(String path)
{
  return pluginRetrievalService.getPlugin().getResource(path) != null;
}

代码示例来源:origin: com.atlassian.plugins/less-transformer-plugin

private String encodeFromDateLastModified(URI uri, Plugin plugin)
{
  URL url = plugin.getResource(getResourcePath(uri));
  URLConnection connection = null;
  try {
    connection = url.openConnection();
    return String.valueOf(connection.getLastModified());
  } catch (IOException e) {
    throw new IllegalStateException(e);
  } finally {
    if (connection != null) {
      try {
        connection.getInputStream().close();
      } catch (IOException ignored) {
      }
    }
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

public ConfigTemplate parse(String configFile, Plugin plugin)
{
  URL configUrl = plugin.getResource(configFile);
  if (configUrl == null)
  {
    throw new IllegalArgumentException("No configuration file: " + configFile);
  }
  InputStream inputStream = null;
  try
  {
    inputStream = configUrl.openStream();
    return parseInput(inputStream, plugin);
  }
  catch (IOException e)
  {
    throw new IllegalArgumentException("Error while reading configuration file: " + configUrl, e);
  }
  finally
  {
    closeQuietly(inputStream);
  }
}

代码示例来源:origin: com.atlassian.plugins/less-transformer-plugin

@Override
public boolean exists(URI uri) {
  Plugin plugin = resolvePlugin(uri);
  String path = getResourcePath(uri);
  return plugin != null && plugin.getResource(path) != null;
}

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-core

@Override
public void init(Plugin plugin, Element element) throws PluginParseException {
  super.init(plugin, element);
  String resourcePath = element.attributeValue("resource");
  URL resource = plugin.getResource(resourcePath);
  assertResourceExists(resourcePath, resource);
  whitelist = loadWhitelist(resourcePath, resource);
}

代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-core

@Override
public void init(Plugin plugin, Element element) throws PluginParseException {
  super.init(plugin, element);
  String resourcePath = element.attributeValue("resource");
  URL resource = plugin.getResource(resourcePath);
  assertResourceExists(resourcePath, resource);
  whitelist = loadWhitelist(resourcePath, resource);
}

代码示例来源:origin: com.atlassian.pluginkit/ringojs-kit

if (TemplateExtension.contains(extension))
  if (plugin.getResource(path) != null)
  if (plugin.getResource(tryPath) != null)

代码示例来源:origin: com.atlassian.soy/soy-template-plugin

private URL getSoyResourceURL(ModuleDescriptor moduleDescriptor, ResourceDescriptor resource) {
  final String sourceParam = resource.getParameter("source");
  if ("webContextStatic".equalsIgnoreCase(sourceParam)) {
    try {
      return servletContextFactory.getServletContext().getResource(resource.getLocation());
    } catch (MalformedURLException e) {
      log.error("Ignoring soy resource. Could not locate soy with location: " + resource.getLocation());
      return null;
    }
  }
  return moduleDescriptor.getPlugin().getResource(resource.getLocation());
}

代码示例来源:origin: com.atlassian.labs/speakeasy-plugin

public String getModuleContents(String moduleName)
{
  Module scannedModule = modules.get(moduleName);
  if (scannedModule == null)
  {
    throw new IllegalArgumentException("Module not found: " + moduleName);
  }
  URL url = null;
  if (!Boolean.getBoolean(PluginUtils.ATLASSIAN_DEV_MODE))
  {
    url = plugin.getResource(getMinifiedModulePath(moduleName));
  }
  if (url == null)
  {
    url = plugin.getResource(scannedModule.getPath());
  }
  long lastModified = determineLastModified(url);
  if (scannedModule.getLastModified() > 0 && scannedModule.getLastModified() < lastModified)
  {
    modules.put(moduleName, scanModule(moduleName, url));
  }
  return readModule(url);
}

代码示例来源:origin: com.atlassian.labs/speakeasy-plugin

extension.setNumFavorites(data.getFavorites(plugin.getKey()).size());
if (plugin.getResource("/" + JsonManifest.ATLASSIAN_EXTENSION_PATH) != null)
  extension.setDescription(((UnloadablePlugin) plugin).getErrorText());
else if (plugin.getResource("/atlassian-plugin.xml") != null)

相关文章