Package java.net

Examples of java.net.URL.toExternalForm()


            throw new DeployerException("Cannot get the URL for the deployable '" + earDeployable + "'.", e);
        }

        // Create a Root classloader for this EAR
        // Empty classloader
        URLClassLoader earClassLoader = (URLClassLoader) newInstance(this.jClassLoaderConstructor, earURL.toExternalForm(), new URL[0],
                Thread.currentThread().getContextClassLoader());

        // Get the URLs of EJB, WEB and Clients
        List<URL> urlsEJB = new ArrayList<URL>();
        for (EJBDeployable ejb : earDeployable.getEJBDeployables()) {
View Full Code Here


        // CB TODO, get this from core preferences.
        hClient.getParams().setSoTimeout(
            NetPropertiesHandler.timeoutValue);
        HostConfiguration hc = hClient.getHostConfiguration();
        hc = setProxySetttings(hClient, hc);
        gMethod = new GetMethod(lUrl.toExternalForm());

        // Add a byte range header asking for partial content.
        if (pDownload.getAttachment().isIncomplete()) {
          append = true;
          addByteRangeHeader(pDownload.getAttachment(), gMethod);
View Full Code Here

            break;
          case HttpStatus.SC_METHOD_NOT_ALLOWED: {
            // This sometimes happens, we exit with an error
            // message.
             sLog.warn(gMethod.getStatusLine().getReasonPhrase()
             + " to URL " + lUrl.toExternalForm());
          }
            break;
          default: {
            pDownload.setState(DownloadService.ERROR);
            pDownload.setMessage(gMethod.getStatusLine()
View Full Code Here

    // it seems that FMJ's use of relative file URLs may be nonstandard.
    // see http://en.wikipedia.org/wiki/File_URI_scheme and the things it links to.
   
    // workaround because URL.openConnection does not like relative file URLs.
    if (url.getProtocol().equals("file"))
    {  final String newUrlStr = URLUtils.createAbsoluteFileUrl(url.toExternalForm());
      if (newUrlStr != null)
      {
        if (!newUrlStr.toString().equals(url.toExternalForm()))
        {
          logger.warning("Changing file URL to absolute for URL.openConnection, from " + url.toExternalForm() + " to " + newUrlStr);
View Full Code Here

    // workaround because URL.openConnection does not like relative file URLs.
    if (url.getProtocol().equals("file"))
    {  final String newUrlStr = URLUtils.createAbsoluteFileUrl(url.toExternalForm());
      if (newUrlStr != null)
      {
        if (!newUrlStr.toString().equals(url.toExternalForm()))
        {
          logger.warning("Changing file URL to absolute for URL.openConnection, from " + url.toExternalForm() + " to " + newUrlStr);
          url = new URL(newUrlStr);
        }
      }
View Full Code Here

    final String newUrlStr = URLUtils.createAbsoluteFileUrl(url.toExternalForm());
      if (newUrlStr != null)
      {
        if (!newUrlStr.toString().equals(url.toExternalForm()))
        {
          logger.warning("Changing file URL to absolute for URL.openConnection, from " + url.toExternalForm() + " to " + newUrlStr);
          url = new URL(newUrlStr);
        }
      }
    }
   
View Full Code Here

    ClassLoaderInterface classloader = getClassLoaderInterface();
    try {
      em = classloader.getResources("struts-plugin.xml");
      while (em.hasMoreElements()) {
        URL url = em.nextElement();
        urls.add(new URL(substringBeforeLast(url.toExternalForm(), "struts-plugin.xml")));
      }
      em = classloader.getResources("struts.xml");
      while (em.hasMoreElements()) {
        URL url = em.nextElement();
        urls.add(new URL(substringBeforeLast(url.toExternalForm(), "struts.xml")));
View Full Code Here

        urls.add(new URL(substringBeforeLast(url.toExternalForm(), "struts-plugin.xml")));
      }
      em = classloader.getResources("struts.xml");
      while (em.hasMoreElements()) {
        URL url = em.nextElement();
        urls.add(new URL(substringBeforeLast(url.toExternalForm(), "struts.xml")));
      }
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    logger.info("build action from {}", urls);
View Full Code Here

    RepositoryConnection con1 = rep1.getConnection();

    URL rdf = this.getClass().getResource("/testcases/rdfa-test.rdf");

    con1.add(rdf, rdf.toExternalForm(), RDFFormat.forFileName(rdf.toExternalForm()));

    StringWriter writer = new StringWriter();
    RDFWriter rdfWriter = rdfWriterFactory.getWriter(writer);
    rdfWriter.setBaseURI(rdf.toExternalForm());
    con1.export(rdfWriter);
View Full Code Here

    RepositoryConnection con1 = rep1.getConnection();

    URL rdf = this.getClass().getResource("/testcases/rdfa-test.rdf");

    con1.add(rdf, rdf.toExternalForm(), RDFFormat.forFileName(rdf.toExternalForm()));

    StringWriter writer = new StringWriter();
    RDFWriter rdfWriter = rdfWriterFactory.getWriter(writer);
    rdfWriter.setBaseURI(rdf.toExternalForm());
    con1.export(rdfWriter);
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.