Examples of URLDataSource


Examples of javax.activation.URLDataSource

                        if (getLogger().isDebugEnabled()) {
                            getLogger().debug("cocoon-URI changed to " + iSS);
                        }

                        dataSource = new URLDataSource(new URL(iSS));
                    } else {
                        dataSource = new URLDataSource(new URL(inputSource.getURI()));
                    }

                    messageBodyPart.setDataHandler(new DataHandler(dataSource));
                } else if (aD.isFileSource()) {
                    inputSource = resolver.resolveURI(aD.strAttrFile);
                    dataSource  = new URLDataSource(new URL(inputSource.getURI()));
                    messageBodyPart.setDataHandler(new DataHandler(dataSource));
                }
            } else {
                messageBodyPart.setContent(aD.strContent,
                                           aD.strAttrMimeType);
View Full Code Here

Examples of javax.activation.URLDataSource

                                 String name,
                                 String description,
                                 String disposition)
            throws MessagingException {
        return attach(
                new URLDataSource(url), name, description, disposition);
    }
View Full Code Here

Examples of javax.activation.URLDataSource

    public String embed(URL url, String name)
        throws MessagingException
    {
        MimeBodyPart mbp = new MimeBodyPart();

        mbp.setDataHandler (new DataHandler(new URLDataSource(url)));
        mbp.setFileName(name);
        mbp.setDisposition("inline");
//        String cid = org.apache.commons.util.identifier.StringAlphanumeric10IdentifierFactory.nextIdentifier();
        String cid = "abcdefghij"; // TODO: Isto devia ser random
        mbp.addHeader("Content-ID", cid);
View Full Code Here

Examples of javax.activation.URLDataSource

            return loadDataSource(contentId, atts);
        } else if (contentId.indexOf("://") == -1) {
            return loadDataSource(contentId, atts);
        } else {
            try {
                return new URLDataSource(new URL(contentId));
            } catch (MalformedURLException e) {
                throw new Fault(e);
            }
        }
       
View Full Code Here

Examples of javax.activation.URLDataSource

            }
        }

        // Try loading the URL remotely
        try {
            URLDataSource source = new URLDataSource(new URL(id));
            return new AttachmentImpl(id, new DataHandler(source));
        } catch (MalformedURLException e) {
            return null;
        }
    }
View Full Code Here

Examples of javax.activation.URLDataSource

            return loadDataSource(contentId, atts);
        } else if (contentId.indexOf("://") == -1) {
            return loadDataSource(contentId, atts);
        } else {
            try {
                return new URLDataSource(new URL(contentId));
            } catch (MalformedURLException e) {
                throw new Fault(e);
            }
        }
       
View Full Code Here

Examples of javax.activation.URLDataSource

        TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
        addHandlersProgrammatically(disp, handler);

        URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml");
        DataSource ds = new URLDataSource(is);

        try {
            disp.invoke(ds);
            fail("Did not get expected exception");
        } catch (HTTPException e) {
View Full Code Here

Examples of javax.activation.URLDataSource

        TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
        addHandlersProgrammatically(disp, handler);

        URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml");
        DataSource ds = new URLDataSource(is);

        try {
            disp.invoke(ds);
            fail("Did not get expected exception");
        } catch (HTTPException e) {
View Full Code Here

Examples of javax.activation.URLDataSource

            return loadDataSource(contentId, atts);
        } else if (contentId.indexOf("://") == -1) {
            return loadDataSource(contentId, atts);
        } else {
            try {
                return new URLDataSource(new URL(contentId));
            } catch (MalformedURLException e) {
                throw new Fault(e);
            }
        }
       
View Full Code Here

Examples of javax.activation.URLDataSource

                        if (this.getLogger().isDebugEnabled() == true) {
                            this.getLogger().debug("cocoon-URI changed to " +
                                                   iSS);
                        }

                        dataSource = new URLDataSource(new URL(iSS));
                    } else {
                        dataSource = new URLDataSource(new URL(inputSource.getURI()));
                    }

                    messageBodyPart.setDataHandler(new DataHandler(dataSource));
                } else if (aD.isFileSource()) {
                    inputSource = resolver.resolveURI(aD.strAttrFile);
                    dataSource  = new URLDataSource(new URL(inputSource.getURI()));
                    messageBodyPart.setDataHandler(new DataHandler(dataSource));
                }
            } else {
                messageBodyPart.setContent(aD.strBufContent.toString(),
                                           aD.strAttrMimeType);
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.