Examples of URLDataSource


Examples of javax.activation.URLDataSource

        DataSource ds;
        try {
            File f = new File(getClass().getResource("/log4j.properties").toURI());
            ds = new FileDataSource(f);
        } catch (URISyntaxException ex) {
            ds = new URLDataSource(getClass().getResource("/log4j.properties"));
        }
        DataHandler dh = new DataHandler(ds);

        BodyPart attachmentBodyPart;
        // Create another body part
View Full Code Here

Examples of javax.activation.URLDataSource

  {
    MimeBodyPart b = new MimeBodyPart ();

    try {
      // attach the url to the message
      URLDataSource uds = new URLDataSource(url);
      b.setDataHandler(new DataHandler(uds));
      b.setFileName(name);
    }
    catch (MessagingException exc) {
      myLog.error ("createMimeBodyPart - url = {}", url, exc);
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

    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

Examples of javax.activation.URLDataSource

        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

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

                        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

Examples of javax.media.protocol.URLDataSource

    }
    catch (Exception e)
    {  logger.log(Level.WARNING, ""  + e, e);
      throw new NoProcessorException();
    }
    final URLDataSource dataSource = new URLDataSource(url);
    dataSource.connect();
    return createProcessor(dataSource);
  }
View Full Code Here

Examples of javax.media.protocol.URLDataSource

    }
    catch (Exception e)
    {  logger.log(Level.WARNING, ""  + e, e);
      throw new NoDataSourceException();
    }
    final URLDataSource dataSource = new URLDataSource(url);
    dataSource.connect();
    return dataSource;
  }
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.