Package org.jboss.shrinkwrap.api.asset

Examples of org.jboss.shrinkwrap.api.asset.UrlAsset


        String serviceActivatorPath = "META-INF/services/" + ServiceActivator.class.getName();
        final URL serviceActivatorURL = this.getClass().getClassLoader().getResource("arquillian-service/" + serviceActivatorPath);
        if (serviceActivatorURL == null) {
            throw new RuntimeException("No arquillian-service/" + serviceActivatorPath + " found by classloader: " + this.getClass().getClassLoader());
        }
        archive.addAsResource(new UrlAsset(serviceActivatorURL), serviceActivatorPath);

        // Replace the loadable extensions with the collected set
        archive.delete(ArchivePaths.create(loadableExtensionsPath));
        archive.addAsResource(new Asset() {
            @Override
View Full Code Here


                final URL url = entry.getValue();
                final String name = entry.getKey();


                if (name.endsWith(".xml")) {
                    this.archive.add(new Named("WEB-INF/" + name, new UrlAsset(url)));
                } else {
                    boolean keep = true;
                    if (excluded != null) {
                        for (Class<?> excludedClazz : excluded) {
                            if (name.equals(excludedClazz.getSimpleName().concat(".class"))) {
                                keep = false;
                            }
                        }
                    }

                    if (keep) {
                        final String path = url.getPath();
                        final String relativePath = path.substring(path.indexOf(packageName));
                        this.archive.add(new Named("WEB-INF/classes/" + relativePath, new UrlAsset(url)));
                    }
                }
            }
        } catch (IOException e) {
            throw new IllegalStateException("cannot list package contents", e);
View Full Code Here

     * @see org.jboss.shrinkwrap.portal.api.container.PortletContainer#setPortletXML(java.net.URL)
     */
    @Override
    public T setPortletXML(URL resource) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource should be specified");
        return setPortletXML(new UrlAsset(resource));
    }
View Full Code Here

        String serviceActivatorPath = "META-INF/services/" + ServiceActivator.class.getName();
        final URL serviceActivatorURL = this.getClass().getClassLoader().getResource("arquillian-service/" + serviceActivatorPath);
        if (serviceActivatorURL == null) {
            throw new RuntimeException("No arquillian-service/" + serviceActivatorPath + " found by classloader: " + this.getClass().getClassLoader());
        }
        archive.addAsResource(new UrlAsset(serviceActivatorURL), serviceActivatorPath);

        // Add META-INF/jbosgi-xservice.properties which registers the arquillian service with the OSGi layer
        // Generated default imports for OSGi tests are defined in {@link AbstractOSGiApplicationArchiveProcessor}
        StringBuffer props = new StringBuffer(Constants.BUNDLE_SYMBOLICNAME + ": " + archive.getName() + "\n");
        props.append(Constants.EXPORT_PACKAGE + ": ");
View Full Code Here

    }

    @Override
    public RhqAgentPluginArchive setPluginDescriptor(URL url) throws IllegalArgumentException {
        Validate.notNull(url, "URL should be specified");
        return setPluginDescriptor(new UrlAsset(url));
    }
View Full Code Here

                final URL url = entry.getValue();
                final String name = entry.getKey();


                if (name.endsWith(".xml")) {
                    this.archive.add(new Named("WEB-INF/" + name, new UrlAsset(url)));
                } else {
                    boolean keep = true;
                    if (excluded != null) {
                        for (final Class<?> excludedClazz : excluded) {
                            if (name.equals(excludedClazz.getSimpleName().concat(".class"))) {
                                keep = false;
                            }
                        }
                    }

                    if (keep) {
                        final String path = url.getPath();
                        final String relativePath = path.substring(path.indexOf(packageName));
                        this.archive.add(new Named("WEB-INF/classes/" + relativePath, new UrlAsset(url)));
                    }
                }
            }
        } catch (final IOException e) {
            throw new IllegalStateException("cannot list package contents", e);
View Full Code Here

        String serviceActivatorPath = "META-INF/services/" + ServiceActivator.class.getName();
        final URL serviceActivatorURL = this.getClass().getClassLoader().getResource("arquillian-service/" + serviceActivatorPath);
        if (serviceActivatorURL == null) {
            throw new RuntimeException("No arquillian-service/" + serviceActivatorPath + " found by classloader: " + this.getClass().getClassLoader());
        }
        archive.addAsResource(new UrlAsset(serviceActivatorURL), serviceActivatorPath);

        // Add resource capabilities for registration with the Environment
        archive.addAsResource(new Asset() {
            public InputStream openStream() {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

        String serviceActivatorPath = "META-INF/services/" + ServiceActivator.class.getName();
        final URL serviceActivatorURL = this.getClass().getClassLoader().getResource("arquillian-service/" + serviceActivatorPath);
        if (serviceActivatorURL == null) {
            throw new RuntimeException("No arquillian-service/" + serviceActivatorPath + " found by classloader: " + this.getClass().getClassLoader());
        }
        archive.addAsResource(new UrlAsset(serviceActivatorURL), serviceActivatorPath);

        // Replace the loadable extensions with the collected set
        archive.delete(ArchivePaths.create(loadableExtentionsPath));
        archive.addAsResource(new Asset() {
            @Override
View Full Code Here

        String serviceActivatorPath = "META-INF/services/" + ServiceActivator.class.getName();
        final URL serviceActivatorURL = this.getClass().getClassLoader().getResource("arquillian-service/" + serviceActivatorPath);
        if (serviceActivatorURL == null) {
            throw new RuntimeException("No arquillian-service/" + serviceActivatorPath + " found by classloader: " + this.getClass().getClassLoader());
        }
        archive.addAsResource(new UrlAsset(serviceActivatorURL), serviceActivatorPath);

        // Replace the loadable extensions with the collected set
        archive.delete(ArchivePaths.create(loadableExtentionsPath));
        archive.addAsResource(new Asset() {
            @Override
View Full Code Here

        String serviceActivatorPath = "META-INF/services/" + ServiceActivator.class.getName();
        final URL serviceActivatorURL = this.getClass().getClassLoader().getResource("arquillian-service/" + serviceActivatorPath);
        if (serviceActivatorURL == null) {
            throw new RuntimeException("No arquillian-service/" + serviceActivatorPath + " found by classloader: " + this.getClass().getClassLoader());
        }
        archive.addAsResource(new UrlAsset(serviceActivatorURL), serviceActivatorPath);

        // Add resource capabilities for registration with the Environment
        archive.addAsResource(new Asset() {
            public InputStream openStream() {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.api.asset.UrlAsset

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.