Package java.net

Examples of java.net.URL.toExternalForm()


    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);

    long before = con1.size();
    con1.close();
View Full Code Here


    Repository rep2 = new SailRepository(new MemoryStore());
    rep2.initialize();

    RepositoryConnection con2 = rep2.getConnection();

    con2.add(new StringReader(writer.toString()), rdf.toExternalForm(), rdfWriterFactory.getRDFFormat());
    long after = con2.size();
    con2.close();

    assertEquals("result of serialization and re-upload should be equal to original", before, after);
View Full Code Here

      DeploymentManager deployMgr = getDeploymentManager();
      URL contentURL = getDeployURL(name);
      assertNotNull(contentURL);
      getLog().debug(contentURL);
      // TODO - hack to get off JDK's url handling
      String urlString = contentURL.toExternalForm();
      int p = urlString.indexOf(":/");
      contentURL = new URL("file" + urlString.substring(p));
      getLog().debug(contentURL);

      DeploymentStatus status;
View Full Code Here

            return null;
        }
        String protocol = jar.getProtocol().toLowerCase();
        try {
            if (protocol.startsWith("jar")) {
                return new StandardPluginLocation(new URL(jar.toExternalForm()
                    .replaceFirst("!(.*?)$", Util.joinPath("!", context))), jar);
            } else if (protocol.startsWith("file")) {
                File f = new File(jar.toURI());
                return new StandardPluginLocation(f.getParentFile(), manifest);
            }
View Full Code Here

    try {
      aURL = aFile.toURL();
    } catch (java.net.MalformedURLException e) {
      throw new IOException("File " + aFile + " had invalid URL representation.");
    }
    return parse(cBuilder, new InputSource(aURL.toExternalForm()), aURL);
  }

  /**
   * Parse feed from input source with base location set and create channel.
   *
 
View Full Code Here

      aURL = aFile.toURL();
    } catch (java.net.MalformedURLException e) {
      throw new IOException("File " + aFile + " had invalid URL " +
                            "representation.");
    }
    return parse(new InputSource(aURL.toExternalForm()), aURL);
  }

  public static Collection<FeedIF> parse(InputSource inpSource,
                                URL baseLocation) throws IOException, ParseException {
    // document reading without validation
View Full Code Here

        if (resources.length > 1) {
          log.debug("Combined resource not found: {}", localResourcePath);
        }
        return null;
      } else {
        log.debug(resource.toExternalForm());
        resources[i] = resource;
      }
    }
    return resources;
  }
View Full Code Here

        if (resources.length > 1) {
          log.debug("Combined resource not found: {}", localResourcePath);
        }
        return null;
      } else {
        log.debug(resource.toExternalForm());
        resources[i] = resource;
      }
    }
    return resources;
  }
View Full Code Here

      // Set the JAAS login config file if not already set
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      URL loginConfig = loader.getResource(authConfig);
      if( loginConfig != null )
      {
         System.setProperty("java.security.auth.login.config", loginConfig.toExternalForm());
         log.info("Using JAAS LoginConfig: " + loginConfig.toExternalForm());
      }
      else
      {
         log.warn("Resource: " + authConfig + " not found");
View Full Code Here

      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      URL loginConfig = loader.getResource(authConfig);
      if( loginConfig != null )
      {
         System.setProperty("java.security.auth.login.config", loginConfig.toExternalForm());
         log.info("Using JAAS LoginConfig: " + loginConfig.toExternalForm());
      }
      else
      {
         log.warn("Resource: " + authConfig + " not found");
      }
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.