Examples of toUri()


Examples of java.net.URL.toURI()

    * We test only the first item under a channel
    */
   public void testRssItemLinks() throws Exception
   {
      URL url = new URL("http://www.lagazettedescommunes.com/RSS/generateRSS.asp");
      RSSDocument<DefaultRSSChannel, DefaultRSSItem> document = parser_.createDocument(url.toURI(), "utf-8");
      if (document != null)
      {
         DefaultRSSItem firstItem = document.getItem(0);
         System.out.println("Creator: " + firstItem.getCreator());
         System.out.println("Description: " + firstItem.getDesc());
View Full Code Here

Examples of java.net.URL.toURI()

    @Override
    public File getConfigFile(Context ctx) {
        URL configUrl = ctx.getConfigFile();
        if (configUrl != null) {
            try {
                URI configUri = configUrl.toURI();
                if ("file".equals(configUri.getScheme())) {
                    return new File(configUri.getPath());
                }
            } catch (Exception ex) {
                logger.error("Could not convert URL to URI: " + configUrl, ex);
View Full Code Here

Examples of java.nio.file.Path.toUri()

      if (configuredContext.getContextFile() != null) {
        Path contextFilePath = Paths.get(configuredContext.getContextFile());
        if (Files.exists(contextFilePath)) {
          try {
            URL contextFileURL = contextFilePath.toUri().toURL();
            ctx.setConfigFile(contextFileURL);
          } catch (Exception e) {
            getLogger().error("Problem with the context file: " + e.getMessage());
          }
        }
View Full Code Here

Examples of javax.tools.FileObject.toUri()

            try {
                resource = filer.getResource(StandardLocation.CLASS_OUTPUT, packageName, fileName);
            } catch (Throwable e) {
                resource = filer.createResource(StandardLocation.CLASS_OUTPUT, packageName, fileName);
            }
            URI uri = resource.toUri();
            File file = null;
            if (uri != null) {
                try {
                    file = new File(uri.getPath());
                } catch (Exception e) {
View Full Code Here

Examples of javax.tools.JavaFileObject.toUri()

     *
     */
    private PrintWriter createSourceFile(String originalClass, String metaClass, TypeElement e)
        throws IOException {
        JavaFileObject javaFile = processingEnv.getFiler().createSourceFile(metaClass, e);
        logger.info(_loc.get("mmg-process", javaFile.toUri().normalize()));
        return new PrintWriter(javaFile.openWriter());
    }
   
    /**
     * Get the value for the given keys, whoever matches first, in the current available options.
View Full Code Here

Examples of org.apache.abdera.i18n.iri.IRI.toURI()

    @Test
    public void testSimple() throws Exception {
        IRI iri = new IRI("http://validator.w3.org/check?uri=http%3A%2F%2Fr\u00E9sum\u00E9.example.org");
        assertEquals("http://validator.w3.org/check?uri=http%3A%2F%2Fr\u00E9sum\u00E9.example.org", iri.toString());
        assertEquals("http://validator.w3.org/check?uri=http%3A%2F%2Fr%C3%A9sum%C3%A9.example.org", iri.toURI()
            .toString());
    }
   
    @Test
    public void testIpv4() throws URISyntaxException{
View Full Code Here

Examples of org.apache.abdera.util.iri.IRI.toURI()

public class TestIRI extends TestCase {

  public static void testSimple() throws Exception {
    IRI iri = new IRI("http://validator.w3.org/check?uri=http%3A%2F%2Fr\u00E9sum\u00E9.example.org");
    assertEquals(iri.toString(),"http://validator.w3.org/check?uri=http%3A%2F%2Fr\u00E9sum\u00E9.example.org");
    assertEquals(iri.toURI().toString(),"http://validator.w3.org/check?uri=http://r%C3%A9sum%C3%A9.example.org");  
  }

  public static void testSimple2() throws Exception {
    IRI iri = new IRI("http://www.example.org/red%09ros\u00E9#red");
    assertEquals(iri.toURI().toString(),"http://www.example.org/red%09ros%C3%A9#red");
View Full Code Here

Examples of org.apache.activemq.util.URISupport.CompositeData.toURI()

            // It might be a composite URI.
            try {
                CompositeData data = URISupport.parseComposite(this.brokerURL);
                if (buildFromMap(IntrospectionSupport.extractProperties(data.getParameters(), "jms."))) {
                    this.brokerURL = data.toURI();
                }
            } catch (URISyntaxException e) {
            }
        }
    }
View Full Code Here

Examples of org.apache.flink.core.fs.Path.toUri()

    final FileBaseStatistics cachedFileStats = (cachedStats != null && cachedStats instanceof FileBaseStatistics) ?
      (FileBaseStatistics) cachedStats : null;
       
    try {
      final Path path = this.filePath;
      final FileSystem fs = FileSystem.get(path.toUri());
     
      return getFileStats(cachedFileStats, path, fs, new ArrayList<FileStatus>(1));
    } catch (IOException ioex) {
      if (LOG.isWarnEnabled()) {
        LOG.warn("Could not determine statistics for file '" + this.filePath + "' due to an io error: "
View Full Code Here

Examples of org.apache.geronimo.gbean.AbstractName.toURI()

                    if (State.RUNNING_INDEX != kernel.getGBeanState(gbeanName)) {
                        String stateReason = null;
                        if (kernel instanceof BasicKernel) {
                            stateReason = ((BasicKernel) kernel).getStateReason(gbeanName);
                        }
                        String name = gbeanName.toURI().getQuery();
                        if (stateReason != null) {
                            unstarted.add("The service " + name + " did not start because " + stateReason);
                        } else {
                            unstarted.add("The service " + name + " did not start for an unknown reason");
                        }
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.