Examples of ArtifactResource


Examples of org.apache.ace.client.repository.helper.ArtifactResource

        }

        // If available, sort the references by service ranking.
        Arrays.sort(refs, SERVICE_RANK_COMPARATOR);

        ArtifactResource resource = convertToArtifactResource(url);

        // Check all referenced services to find one that matches our input.
        ArtifactRecognizer recognizer = null;
        String foundMimetype = null;
        for (ServiceReference ref : refs) {
View Full Code Here

Examples of org.apache.ace.client.repository.helper.ArtifactResource

            throw ioe;
        }
    }

    private ArtifactObject importArtifact(URL artifact, ArtifactRecognizer recognizer, ArtifactHelper helper, String mimetype, boolean overwrite, boolean upload) throws IOException {
        ArtifactResource resource = convertToArtifactResource(artifact);

        Map<String, String> attributes = recognizer.extractMetaData(resource);
        Map<String, String> tags = new HashMap<String, String>();

        helper.checkAttributes(attributes);
View Full Code Here

Examples of org.apache.ace.client.repository.helper.ArtifactResource

    private ArtifactResource convertToArtifactResource(final URL url) {
        if (url == null) {
            return null;
        }

        return new ArtifactResource() {
            public URL getURL() {
                return url;
            }

            public InputStream openStream() throws IOException {
View Full Code Here

Examples of org.apache.ace.client.repository.helper.ArtifactResource

        assert !m_helper.canHandle("somecrazy/mimetype") : "Should not be able to handle crazy mimetype.";
    }

    @Test(groups = { UNIT })
    public void testManifestExtraction() {
        ArtifactResource artifact = new ArtifactResource() {

            @Override
            public InputStream openStream() throws IOException {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                Manifest manifest = new Manifest();
View Full Code Here

Examples of org.apache.ace.client.repository.helper.ArtifactResource

        assert "My Cool Bundle-1.0.0".equals(map.get(ArtifactObject.KEY_ARTIFACT_NAME)) : "Artifact name should have been 'My Cool Bundle-1.0.0', was " + map.get(ArtifactObject.KEY_ARTIFACT_NAME);
    }

    @Test(groups = { UNIT })
    public void testLocalizedManifestExtraction() {
        ArtifactResource artifact = new ArtifactResource() {

            @Override
            public InputStream openStream() throws IOException {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                Manifest manifest = new Manifest();
View Full Code Here

Examples of org.apache.ace.client.repository.helper.ArtifactResource

            return null;
        }
       
        final URL url = getClass().getClassLoader().getResource("./" + res);
       
        return new ArtifactResource() {
            public URL getURL() {
                return url;
            }
           
            public InputStream openStream() throws IOException {
View Full Code Here

Examples of org.apache.ace.client.repository.helper.ArtifactResource

    @Test(groups = { UNIT })
    public void testLocalizedManifestExtractionWithDefaultBase() {

        // note that we do not set the Bundle-Localization header

        ArtifactResource artifact = new ArtifactResource() {

            @Override
            public InputStream openStream() throws IOException {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                Manifest manifest = new Manifest();
View Full Code Here

Examples of org.apache.ace.client.repository.helper.ArtifactResource

        assert "The Coolest Bundle-1.0.0".equals(map.get(ArtifactObject.KEY_ARTIFACT_NAME)) : "Artifact name should have been 'The Coolest Bundle-1.0.0', was " + map.get(ArtifactObject.KEY_ARTIFACT_NAME);
    }

    @Test(groups = { UNIT })
    public void testLocalizedManifestExtractionWithLocale() {
        ArtifactResource artifact = new ArtifactResource() {

            @Override
            public InputStream openStream() throws IOException {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                Manifest manifest = new Manifest();
View Full Code Here

Examples of org.apache.ace.client.repository.helper.ArtifactResource

        assert "De koelste Bundle-1.0.0".equals(map.get(ArtifactObject.KEY_ARTIFACT_NAME)) : "Artifact name should have been 'The Coolest Bundle-1.0.0', was " + map.get(ArtifactObject.KEY_ARTIFACT_NAME);
    }

    @Test(groups = { UNIT })
    public void testLocalizedManifestExtractionWithLocaleOverrule() {
        ArtifactResource artifact = new ArtifactResource() {

            @Override
            public InputStream openStream() throws IOException {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                Manifest manifest = new Manifest();
View Full Code Here

Examples of org.apache.ace.client.repository.helper.ArtifactResource

        assertFalse(m_helper.canHandle("somecrazy/mimetype"), "Should not be able to handle crazy mimetype.");
    }

    @Test(groups = { UNIT })
    public void testManifestExtraction() {
        ArtifactResource artifact = new ArtifactResource() {
            @Override
            public InputStream openStream() throws IOException {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                Manifest manifest = new Manifest();
                Attributes attrs = manifest.getMainAttributes();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.