Package java.nio.file

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


            LOG.ignore(e);
            throw new IOException("Unable to build Path from: " + uri,e);
        }

        this.path = path;
        this.uri = path.toUri();
    }

    public PathResource(URL url) throws IOException, URISyntaxException
    {
        this(url.toURI());
View Full Code Here


    for (ToolSourceError buildError : buildErrors) {
      Path path = buildError.getFilePath();
      path = rootPath.resolve(path); // Absolute paths will remain unchanged.
      path = path.normalize();
     
      IFile[] files = ResourceUtils.getWorkspaceRoot().findFilesForLocationURI(path.toUri());
      for (IFile file : files) {
        if(!file.exists())
          continue;
       
        // TODO: check if marker already exists?
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().severe("Problem with the context file: " + e.getMessage());
          }
        }
View Full Code Here

   
    // Absolute path
    Assert.assertEquals("C:\\prog\\java\\workspaces\\test\\ch.inftec.ju\\ju-util\\.", workingPath.toAbsolutePath().toString());
   
    // URIs
    URI workingPathUri = workingPath.toUri();
    Assert.assertEquals("file:///C:/prog/java/workspaces/test/ch.inftec.ju/ju-util/./", workingPathUri.toString());
   
    // Conversions to and from java.io
    File workingPathAsFile = workingPath.toFile();
    Assert.assertEquals(workingPath, workingPathAsFile.toPath());
View Full Code Here

    Map<String,String> overlayConfig = new HashMap<>();
    overlayConfig.put("batch.update-class", ALSUpdate.class.getName());
    overlayConfig.put("batch.storage.data-dir",
                      "\"" + dataDir.toUri() + "\"");
    overlayConfig.put("batch.storage.model-dir",
                      "\"" + modelDir.toUri() + "\"");
    overlayConfig.put("batch.generation-interval-sec",
                      Integer.toString(GEN_INTERVAL_SEC));
    overlayConfig.put("batch.block-interval-sec",
                      Integer.toString(BLOCK_INTERVAL_SEC));
    overlayConfig.put("als.implicit", "false");
View Full Code Here

    Map<String,String> overlayConfig = new HashMap<>();
    overlayConfig.put("batch.update-class", ALSUpdate.class.getName());
    overlayConfig.put("batch.storage.data-dir",
                      "\"" + dataDir.toUri() + "\"");
    overlayConfig.put("batch.storage.model-dir",
                      "\"" + modelDir.toUri() + "\"");
    overlayConfig.put("batch.generation-interval-sec",
                      Integer.toString(GEN_INTERVAL_SEC));
    overlayConfig.put("batch.block-interval-sec",
                      Integer.toString(BLOCK_INTERVAL_SEC));
    // Choose pairs of values where the best is predictable
View Full Code Here

    Path tempDir = getTempDir();
    Path dataDir = tempDir.resolve("data");
    Map<String,String> overlayConfig = new HashMap<>();
    overlayConfig.put("batch.update-class", MockBatchUpdate.class.getName());
    overlayConfig.put("batch.storage.data-dir",
                      "\"" + dataDir.toUri() + "\"");
    overlayConfig.put("batch.storage.model-dir",
                      "\"" + tempDir.resolve("model").toUri() + "\"");
    overlayConfig.put("batch.generation-interval-sec",
                      Integer.toString(GEN_INTERVAL_SEC));
    overlayConfig.put("batch.block-interval-sec",
View Full Code Here

    Map<String,String> overlayConfig = new HashMap<>();
    overlayConfig.put("batch.update-class", MockMLUpdate.class.getName());
    overlayConfig.put("batch.storage.data-dir",
                      "\"" + dataDir.toUri() + "\"");
    overlayConfig.put("batch.storage.model-dir",
                      "\"" + modelDir.toUri() + "\"");
    overlayConfig.put("batch.generation-interval-sec",
                      Integer.toString(GEN_INTERVAL_SEC));
    overlayConfig.put("batch.block-interval-sec",
                      Integer.toString(BLOCK_INTERVAL_SEC));
    overlayConfig.put("ml.eval.test-fraction", Double.toString(TEST_FRACTION));
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

            // open results in browser
            if (params.openResultsInBrowser()) {
                try {
                    Path htmlDashboard = Paths.get("test/reports/results.html");
                    Desktop.getDesktop().browse(htmlDashboard.toUri());
                } catch (Exception ignore) {
                    LOGGER.error("Could not start browser", ignore);
                }

            }
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.