本文整理了Java中com.atlassian.plugin.Plugin.getResourceAsStream()
方法的一些代码示例,展示了Plugin.getResourceAsStream()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.getResourceAsStream()
方法的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
方法名:getResourceAsStream
暂无
代码示例来源:origin: com.atlassian.analytics/analytics-client
public InputStream readFilterList(final String resourceName)
{
return plugin.getResourceAsStream(resourceName);
}
}).readJsonFilterList(resourceName), true);
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-schema
@Override
public InputStream getResourceAsStream(final String name) {
return plugin.getResourceAsStream(name);
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core
@Override
public InputStream getResourceAsStream(final String name) {
return plugin.getResourceAsStream(name);
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-schema-plugin
@Override
public InputStream getResourceAsStream(final String name)
{
return plugin.getResourceAsStream(name);
}
}
代码示例来源:origin: org.randombits.confluence/confluence-conveyor
@Override
protected InputStream getInputStream( String fileName ) {
return plugin.getResourceAsStream( fileName );
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-webresource-common
@Override
protected InputStream getResourceAsStream(final String resourceLocation) {
return plugin.getResourceAsStream(resourceLocation);
}
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public Option<InputStream> getResourceAsStream(final Plugin plugin, final String resourcePath)
{
return Option.option(plugin.getResourceAsStream(resourcePath));
}
代码示例来源:origin: com.atlassian.labs/speakeasy-plugin
private static Template compile(Plugin plugin, String path)
{
InputStream in = null;
try
{
in = plugin.getResourceAsStream(path);
return Mustache.compiler().standardsMode(true).compile(new InputStreamReader(in));
}
finally
{
IOUtils.closeQuietly(in);
}
}
代码示例来源:origin: com.atlassian.plugins/less-transformer-plugin
@Override
public InputStream open(URI uri) throws IOException {
Plugin plugin = resolvePlugin(uri);
InputStream in = plugin.getResourceAsStream(getResourcePath(uri));
if (in == null) {
throw new IOException(uri.getPath() + " does not exist in plugin " + plugin.getKey());
}
return in;
}
代码示例来源:origin: com.atlassian.labs/speakeasy-plugin
private static Template compile(Plugin plugin, String path)
{
InputStream in = null;
try
{
in = plugin.getResourceAsStream(path);
return Mustache.compiler().standardsMode(true).compile(new InputStreamReader(in));
}
finally
{
IOUtils.closeQuietly(in);
}
}
}
代码示例来源:origin: com.atlassian.pluginkit/ringojs-kit
@Override
public String render(String path, Map<String, Object> context)
{
InputStream stream = plugin.getResourceAsStream(path);
InputStreamReader reader = new InputStreamReader(stream);
StringWriter writer = new StringWriter();
try
{
Mustache.compiler().compile(reader).execute(context, writer);
}
finally
{
try
{
stream.close();
}
catch (IOException ioe)
{
throw new RuntimeException(ioe);
}
}
return writer.toString();
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-core
public CacheEntry(String path) {
setContentType(path);
InputStream in;
try {
in = plugin.getResourceAsStream(path);
if (in == null) {
clear();
} else {
setData(IOUtils.toByteArray(in));
}
} catch (IOException e) {
log.error("Unable to retrieve content: " + path, e);
clear();
}
ttl = path.startsWith("aui/") ? AUI_TTL_FAR_FUTURE : PLUGIN_TTL_NEAR_FUTURE;
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-core
public CacheEntry(String path) {
setContentType(path);
InputStream in;
try {
in = plugin.getResourceAsStream(path);
if (in == null) {
clear();
} else {
setData(IOUtils.toByteArray(in));
}
} catch (IOException e) {
log.error("Unable to retrieve content: " + path, e);
clear();
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-webresource
/**
* Returns stream for file with given location for given resource.
*/
public InputStream getStreamFor(Resource resource, String path) {
if (resource instanceof ModuleResource) {
return getPlugin(((ModuleResource) resource).getPluginKey()).getResourceAsStream(path);
} else {
ResourceLocation resourceLocation = resource.getResourceLocation();
String sourceParam = resourceLocation.getParameter(SOURCE_PARAM_NAME);
final boolean isWebContextStatic = "webContextStatic".equalsIgnoreCase(sourceParam);
if (isWebContextStatic) {
// Tomcat 8 requires resource path to start with the slash.
String pathWithSlash = path.startsWith("/") ? path : "/" + path;
return servletContextFactory.getServletContext().getResourceAsStream(pathWithSlash);
} else {
return getPlugin(resource.getKey()).getResourceAsStream(path);
}
}
}
代码示例来源:origin: com.atlassian.labs/speakeasy-plugin
private void registerSpeakeasyWebItems(Bundle bundle, Plugin plugin)
{
try
{
for (Element element : jsonToElementParser.createWebItems(plugin.getResourceAsStream("ui/web-items.json")))
{
SpeakeasyWebItemModuleDescriptor descriptor = new SpeakeasyWebItemModuleDescriptor(moduleFactory, bundleContext, descriptorGeneratorManager, webResourceManager);
descriptor.init(plugin, element);
bundle.getBundleContext().registerService(ModuleDescriptor.class.getName(), descriptor, null);
}
}
catch (PluginOperationFailedException e)
{
e.setPluginKey(plugin.getKey());
throw e;
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-webresource
protected Map<String, List<WebModuleDescriptor>> parseAtlassianModules(Plugin plugin) {
InputStream stream = plugin.getResourceAsStream(ATLASSIAN_MODULES_XML);
if (stream == null) {
supportLogger.error("no " + ATLASSIAN_MODULES_XML + " for \"" + plugin.getKey() + "\" plugin!");
代码示例来源:origin: com.atlassian.jira/jira-core
if (plugin != null)
InputStream resourceAsStream = plugin.getResourceAsStream(resourcePath);
if (resourceAsStream != null)
代码示例来源:origin: com.atlassian.analytics/analytics-client
inputStream = plugin.getResourceAsStream(resourceName);
代码示例来源:origin: com.atlassian.labs/speakeasy-plugin
public JsonManifest read(Plugin plugin)
{
try
{
JsonManifest mf = JsonObjectMapper.read(JsonManifest.class,
new NamedBufferedInputStream(plugin.getResourceAsStream(JsonManifest.ATLASSIAN_EXTENSION_PATH)));
mf.setKey(plugin.getKey());
return mf;
}
catch (IOException e)
{
throw new PluginOperationFailedException("Unable to parse " + JsonManifest.ATLASSIAN_EXTENSION_PATH, e, null);
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
throws FileNotFoundException
InputStream inputStream = plugin.getResourceAsStream(location);
if (inputStream == null)
内容来源于网络,如有侵权,请联系作者删除!