Package java.nio.file

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


      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

    System.out.printf("Files in directory '%s'\n", tempDir.getName());
    try (DirectoryStream<Path> stream = Files.newDirectoryStream(tempDirPathRef, "*.tmp")) {
      tmpIter = stream.iterator();
      while (tmpIter.hasNext()) {
        p = tmpIter.next();
        System.out.println(p.toUri());
      }
    }
  }

  /**
 
View Full Code Here

                    final WatchEvent<Path> ev = (WatchEvent<Path>) event;
                    final Path filename = ev.context(); // The filename is the context of the event.
                    final Path child = moduleDir.resolve(filename); // Resolve the filename against the directory.
                    if (isValidFile(child, kind == ENTRY_DELETE)) {
                        try {
                            final URL jarUrl = child.toUri().toURL();

                            LOG.info("Filesystem monitor: detected module file {} {}", child,
                                    kind == ENTRY_CREATE ? "created"
                                    : kind == ENTRY_MODIFY ? "modified"
                                    : kind == ENTRY_DELETE ? "deleted"
View Full Code Here

   
    Path normalizedPath = filePath.normalize();
    System.out.println(normalizedPath);
   
    System.out.println(filePath.toUri());
    System.out.println(normalizedPath.toUri());
   
    System.out.println(filePath.toAbsolutePath());
    System.out.println(filePath.toAbsolutePath().normalize());

    System.out.println(filePath.toRealPath());
View Full Code Here

      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

            return null;
        try {
            for (Object o : paths) {
                final Path p = resolve(o, name);
                if (Files.exists(p))
                    return p.toUri().toURL();
            }
            return null;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

        try {
            List<URL> urls = new ArrayList<>();
            for (Object o : paths) {
                final Path p = resolve(o, name);
                if (Files.exists(p))
                    urls.add(p.toUri().toURL());
            }
            return Collections.enumeration(urls);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    String possibleCompilerExeNames[] = getPossibleInterpreterNames();
   
    for (String possibleCompilerExeName : possibleCompilerExeNames) {
      Path compileExeLocation = exeDir.resolve(possibleCompilerExeName);
      if(compileExeLocation.toFile().isFile()) {
        return LocalEnvironment.getInstance().getFile(compileExeLocation.toUri());
      }
      // Try .exe extension. Note, it is intentional that both extensions are checked regardless of
      // what actual platform we are on.
      compileExeLocation = exeDir.resolve(possibleCompilerExeName + ".exe");
      if(compileExeLocation.toFile().isFile()) {
View Full Code Here

      }
      // Try .exe extension. Note, it is intentional that both extensions are checked regardless of
      // what actual platform we are on.
      compileExeLocation = exeDir.resolve(possibleCompilerExeName + ".exe");
      if(compileExeLocation.toFile().isFile()) {
        return LocalEnvironment.getInstance().getFile(compileExeLocation.toUri());
      }
    }
   
    return null;
  }
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.