Examples of URLDataSource


Examples of edu.indiana.dlib.metsnav.config.URLDataSource

    JSONObject jo = new JSONObject();
        JSONArray array = new JSONArray();
        MetsObjectController controller = null;
        String json = null;
    try {
        DataSourceConfig dsConfig = new URLDataSource();
        dsConfig.setDaoType("edu.indiana.dlib.metsnav.dao.PersistentMetsFileDAO");
        CollectionConfig config = new CollectionConfig();
        config.setDataSource(dsConfig);
        controller = new MetsObjectController(config);       
          MetsObject metsObj = controller.getMetsObject(oid);
View Full Code Here

Examples of edu.uga.galileo.slash.utilities.URLDataSource

    setProjectHandle("nge");

    // get extra data (title + media type) from the nge service
    String extraData = null;
    if (Pattern.matches("[a-z]-\\d+", getQuery1())) {
      URLDataSource uds = new URLDataSource();
      try {
        extraData = uds.retrieveWithTimeout(
            "http://draco.gsu.edu/nge/statistics/SLAShInfoService.jsp?id="
                + getQuery1(), 30000);
        if ((extraData != null) && (extraData.trim().equals("null"))) {
          extraData = null;
        }
View Full Code Here

Examples of edu.uga.galileo.voci.utilities.URLDataSource

    ultimateType = vociTypeToUltimate.get(type);
    String url = "http://dlg.galileo.usg.edu/cgi-bin/meta.cgi?" + "dbs="
        + ultimateType + "&userid=ultimate_xml&nc=1&" + "query="
        + query + "&numrecs=" + maxNumRecs;
    URLDataSource uds = new URLDataSource();
    String result = "";

    try
    {
      result = uds.retrieveWithTimeout(url, 300000,
          "Mozilla/5.0 (CRDL; http://www.crdl.org)",
          "VOCI / cbking@uga.edu");
    }
    catch( IOException ioex )
    {
View Full Code Here

Examples of javax.activation.URLDataSource

    HtmlStreamOutput html = new HtmlStreamOutput();
    html.setOutputFormates("text/html");
    try {
      // Also look at
      //StreamingDataHandler
      html.setHtml(new DataHandler(new URLDataSource(new URL("http://code.google.com/p/jsonwebservice/wiki/GettingStarted"))));
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
    return html;
  }
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.turbine.util.GenerateUniqueId.getIdentifier();
        mbp.addHeader("Content-ID", cid);
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

    DataHandler dh = null;
    if (src == null) {
      dh = (DataHandler)DataHandlerUtils.getDataHandlerFromText(
        getText(), (type != null) ? type.toString() : null);
    } else {
      dh = new DataHandler(new URLDataSource(src));
    }
    return dh;
  }
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

        // check if a URLDataSource for this name has already been attached;
        // if so, return the cached CID value.
        if (inlineEmbeds.containsKey(name))
        {
            InlineImage ii = (InlineImage) inlineEmbeds.get(name);
            URLDataSource urlDataSource = (URLDataSource) ii.getDataSource();
            // make sure the supplied URL points to the same thing
            // as the one already associated with this name.
            // NOTE: Comparing URLs with URL.equals() is a blocking operation
            // in the case of a network failure therefore we use
            // url.toExternalForm().equals() here.
            if (url.toExternalForm().equals(urlDataSource.getURL().toExternalForm()))
            {
                return ii.getCid();
            }
            else
            {
                throw new EmailException("embedded name '" + name
                    + "' is already bound to URL " + urlDataSource.getURL()
                    + "; existing names cannot be rebound");
            }
        }

        // verify that the URL is valid
        InputStream is = null;
        try
        {
            is = url.openStream();
        }
        catch (IOException e)
        {
            throw new EmailException("Invalid URL", e);
        }
        finally
        {
            try
            {
                if (is != null)
                {
                    is.close();
                }
            }
            catch (IOException ioe)
            { /* sigh */ }
        }

        return embed(new URLDataSource(url), name);
    }
View Full Code Here

Examples of javax.activation.URLDataSource

       catch (IOException e)
       {
           throw new EmailException("Invalid URL set:" + url, e);
       }

       return attach(new URLDataSource(url), name, description, disposition);
    }
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.