Package javax.activation

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


    public DataSource getTestResourceDataSource(String relativePath) {
        URL url = AbstractTestCase.class.getClassLoader().getResource(relativePath);
        if (url == null) {
            fail("The test resource " + relativePath + " could not be found");
        }
        return new URLDataSource(url);
    }
View Full Code Here

        throws MessagingException
    {
        MimeBodyPart mbp = new MimeBodyPart();
        htmlContent.addBodyPart( mbp );

        mbp.setDataHandler ( new DataHandler( new URLDataSource(url) ) );
        mbp.setFileName( name );
        mbp.setDisposition("inline");
        String cid = org.apache.turbine.util.GenerateUniqueId.getIdentifier();
        mbp.addHeader("Content-ID", cid);
        return mbp.getContentID();
View Full Code Here

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

                        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

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

    entry5.addLink("/2003/12/13/atom03/4");
    entry5.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5c");
    entry5.setUpdated(new Date());
    entry5.setSummary("A simple Base64 encoded binary image");
    URL url = Create.class.getResource("/atom-logo75px.gif");
    entry5.setContent(new DataHandler(new URLDataSource(url)), "image/gif");
   
    // XML content
    Entry entry6 = feed.addEntry();
    entry6.setTitle("re: Atom-Powered Robots Run Amok");
    entry6.addLink("/2003/12/13/atom03/5");
View Full Code Here

        if (resource.exists()) {
          if (resource.getType().equals(FileType.FOLDER)) {
            throw new WGAServiceException(new IllegalArgumentException("Cannot retrieve content of a folder."));
          }
          else {
            return new URLDataSource(resource.getURL());
          }
        }     
      } catch (FileSystemException e) {       
        throw new WGAServiceException("Retrieving content of FSDesignResource '" + state.getPath() + "' failed.", e);
      }     
View Full Code Here

                    }
                }

                messageBodyPart = new MimeBodyPart();

                DataSource source = new URLDataSource(fileURL);
                messageBodyPart.setDataHandler(new DataHandler(source));
                messageBodyPart.setFileName(filename);
                multipart.addBodyPart(messageBodyPart);

            }
View Full Code Here

    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.turbine.util.GenerateUniqueId.getIdentifier();
        mbp.addHeader("Content-ID", cid);
View Full Code Here

TOP

Related Classes of javax.activation.URLDataSource

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.