public InputStream readFilterList(final String resourceName) { return plugin.getResourceAsStream(resourceName); } }).readJsonFilterList(resourceName), true);
@Override public InputStream getResourceAsStream(final String name) { return plugin.getResourceAsStream(name); } }
@Override public InputStream getResourceAsStream(final String name) { return plugin.getResourceAsStream(name); } }
@Override public InputStream getResourceAsStream(final String name) { return plugin.getResourceAsStream(name); } }
@Override protected InputStream getInputStream( String fileName ) { return plugin.getResourceAsStream( fileName ); }
@Override protected InputStream getResourceAsStream(final String resourceLocation) { return plugin.getResourceAsStream(resourceLocation); }
@Override public Option<InputStream> getResourceAsStream(final Plugin plugin, final String resourcePath) { return Option.option(plugin.getResourceAsStream(resourcePath)); }
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); } }
@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; }
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); } } }
@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(); } }
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; }
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(); } }
/** * 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); } } }
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; } }
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!");
if (plugin != null) InputStream resourceAsStream = plugin.getResourceAsStream(resourcePath); if (resourceAsStream != null)
inputStream = plugin.getResourceAsStream(resourceName);
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); } }
throws FileNotFoundException InputStream inputStream = plugin.getResourceAsStream(location); if (inputStream == null)