Package com.atlassian.labs.speakeasy.model

Examples of com.atlassian.labs.speakeasy.model.JsonManifest


        extension.setNumUsers(accessList.size());
        extension.setNumFavorites(data.getFavorites(plugin.getKey()).size());

        if (plugin.getResource("/" + JsonManifest.ATLASSIAN_EXTENSION_PATH) != null)
        {
            JsonManifest mf = jsonManifestHandler.read(plugin);
            extension.setDescription(mf.getDescription());
            extension.setName(mf.getName());
            extension.setExtension("zip");
        }
        // try to detect a failed install of a zip plugin
        else if (plugin instanceof UnloadablePlugin &&
                plugin.getModuleDescriptor("modules") != null &&
View Full Code Here


        File jar = builder.buildWithNoManifest();
        File zip = new File(jar.getPath() + ".zip");
        FileUtils.moveFile(jar, zip);

        final JarPluginArtifact jarArtifact = new JarPluginArtifact(zip);
        JsonManifest jsonMf = new JsonManifestHandler().read(jarArtifact);
        PluginArtifact artifact = zipTransformer.convertConventionZipToPluginJar(jsonMf, jarArtifact);
        JarFile jarFile = new JarFile(artifact.toFile());
        Manifest mf = jarFile.getManifest();
        for (Map.Entry<String,String> entry : expectedHeaders.entrySet())
        {
View Full Code Here

    public String extractPluginKey(PluginArtifact pluginArtifact)
    {
        if (pluginArtifact.doesResourceExist(JsonManifest.ATLASSIAN_EXTENSION_PATH))
        {
            JsonManifest descriptor = jsonHandler.read(pluginArtifact);
            return descriptor.getKey();
        }
        return null;
    }
View Full Code Here

        String pluginKey = OsgiHeaderUtil.getPluginKey(bundle);
        Plugin plugin = pluginAccessor.getPlugin(pluginKey);

        if (bundle.getEntry("atlassian-extension.json") != null)
        {
            JsonManifest mf = jsonManifestHandler.read(plugin);
            if (mf.getScreenshot() != null)
            {
                registerScreenshotWebResourceDescriptor(bundle, factory, plugin, mf.getScreenshot());
            }
        }

        if (bundle.getEntry("js/") != null)
        {
View Full Code Here

    }

    @Override
    protected void forkDescriptor(InputStream original, OutputStream output, String key, String description) throws IOException
    {
        JsonManifest mf = zipTransformer.readManifest(key, original);
        mf.setKey(key);
        mf.setDescription(description);
        zipTransformer.writeManifest(mf, output);
    }
View Full Code Here

    @Override
    protected PluginArtifact validatePluginArtifact(PluginArtifact pluginArtifact)
    {
        if (pluginArtifact.doesResourceExist(JsonManifest.ATLASSIAN_EXTENSION_PATH))
        {
            JsonManifest descriptor = jsonHandler.read(pluginArtifact);
            final List<String> errors = descriptor.isValid(settingsManager.getSettings());
            if (!errors.isEmpty())
            {
                throw new PluginOperationFailedException("Error validating '" + JsonManifest.ATLASSIAN_EXTENSION_PATH + "': " + errors, descriptor.getKey());
            }
            return zipTransformer.convertConventionZipToPluginJar(descriptor, pluginArtifact);
        }
        else
        {
View Full Code Here

    public JsonManifest read(PluginArtifact artifact)
    {
        try
        {
            JsonManifest mf = JsonObjectMapper.read(JsonManifest.class,
                    new NamedBufferedInputStream(artifact.getResourceAsStream(JsonManifest.ATLASSIAN_EXTENSION_PATH)));
            if (mf.getKey() == null)
            {
                mf.setKey(extractFromFilename(artifact.getName()));
            }
            return mf;
        }
        catch (IOException e)
        {
View Full Code Here

    public JsonManifest read(String key, InputStream in)
    {
        try
        {
            JsonManifest mf = JsonObjectMapper.read(JsonManifest.class,
                    new NamedBufferedInputStream(in));
            mf.setKey(key);
            return mf;
        }
        catch (IOException e)
        {
            throw new PluginOperationFailedException("Unable to parse " + JsonManifest.ATLASSIAN_EXTENSION_PATH, e, null);
View Full Code Here

    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);
View Full Code Here

TOP

Related Classes of com.atlassian.labs.speakeasy.model.JsonManifest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.