@Override public URL getResource(final String path) { return plugin.getResource(path); }
private static boolean resourcesAvailable(Plugin plugin, String... resources) { for (final String resource : resources) { if (plugin.getResource(resource) == null) { return false; } } return true; } }
@Override public URL getResource(final String path) { return plugin.getResource(path); }
@Override public URL getResource(final String path) { return plugin.getResource(path); }
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; } }
@Override public Option<URL> getResource(final Plugin plugin, final String resourcePath) { return Option.option(plugin.getResource(resourcePath)); } }
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; } }
private URL getShallowSchemaUrl() { return pluginRetrievalService.getPlugin().getResource("/schema/shallow-schema.json"); } }
protected boolean hasResource(String path) { return pluginRetrievalService.getPlugin().getResource(path) != null; }
private URL getShallowSchemaUrl() { return pluginRetrievalService.getPlugin().getResource("/schema/shallow-schema.json"); } }
protected boolean hasResource(String path) { return pluginRetrievalService.getPlugin().getResource(path) != null; }
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) { } } } }
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); } }
@Override public boolean exists(URI uri) { Plugin plugin = resolvePlugin(uri); String path = getResourcePath(uri); return plugin != null && plugin.getResource(path) != null; }
@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); }
@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); }
if (TemplateExtension.contains(extension)) if (plugin.getResource(path) != null) if (plugin.getResource(tryPath) != null)
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()); }
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); }
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)