Package java.nio.file

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


        try {
            if (!Files.exists(appDir))
                Files.createDirectory(appDir);
            return appDir;
        } catch (IOException e) {
            throw new RuntimeException("Application cache directory " + appDir.toAbsolutePath() + " could not be created.");
        }
    }

    private boolean needsAppCache() {
        if (isEmptyCapsule())
View Full Code Here


    // Creating a new Path
    Path workingPath = Paths.get(".");
    Assert.assertEquals(".", workingPath.toString()); // Note: Path is relative!
   
    // 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());
   
View Full Code Here

  private Context makeContext(Tomcat tomcat, Path noSuchBaseDir) throws IOException {
    Path contextPath = noSuchBaseDir.resolve("context");
    Files.createDirectories(contextPath);

    context = tomcat.addContext(contextPathURIBase, contextPath.toAbsolutePath().toString());

    context.setWebappVersion("3.1");
    context.setName("Oryx");

    // OryxApplication only needs one config value, so just pass it
View Full Code Here

        try {
            if (!Files.exists(appDir))
                Files.createDirectory(appDir);
            return appDir;
        } catch (IOException e) {
            throw new RuntimeException("Application cache directory " + appDir.toAbsolutePath() + " could not be created.");
        }
    }

    private boolean needsAppCache() {
        if (isEmptyCapsule())
View Full Code Here

                        + " JavaVersion: " + getAttribute(ATTR_JAVA_VERSION)
                        + " Min. update version: " + getAttribute(ATTR_MIN_UPDATE_VERSION) + ']'
                        + " (JDK required: " + jdk + ")"
                        + ". You can override the used Java version with the -D" + PROP_CAPSULE_JAVA_HOME + " flag.");
            }
            jhome = javaHomePath.toAbsolutePath().toString();
        }
        return jhome;
    }

    private Path findJavaHome(boolean jdk) {
View Full Code Here

            debug("Offline: " + offline);

            final boolean allowSnapshots = hasAttribute(ATTR_ALLOW_SNAPSHOTS) && Boolean.parseBoolean(getAttribute(ATTR_ALLOW_SNAPSHOTS));
            debug("Allow snapshots: " + offline);

            final DependencyManager dm = new DependencyManagerImpl(localRepo.toAbsolutePath(), repositories, reset, offline, allowSnapshots);

            return dm;
        } catch (NoClassDefFoundError e) {
            throw new RuntimeException("Jar " + jarFile
                    + " specifies dependencies, while the necessary dependency management classes are not found in the jar");
View Full Code Here

    }

    Path extraDir = extractDir.resolve(EXTRA_RESOURCES_DIR);
    if (Files.exists(extraDir)) {
      System.setProperty("EXTRA_RESOURCES_DIR", extraDir.toAbsolutePath()
          .toString());
    }

    if (isWin) {
      String libraryPath = System.getProperty("java.library.path");
View Full Code Here

        // write data to temp dir first
        Path tmpDeployFile = Paths.get("tmp").resolve(operation.getFileMessage().getFilename());
        try {
            Files.write(tmpDeployFile, operation.getFileMessage().getData());
            log.info("Received file is stored to disk");
            return tmpDeployFile.toAbsolutePath();
        } catch (IOException e) {
            throw new DeployException("Couldn't write the container data to "
                    + "the local disk:", e);
        }
    }
View Full Code Here

        scriptContent += "start-jbi-service-assembly " + processName + "Application\n";

        FileTasks.createFile(deployCommands, scriptContent);

        ConsoleTasks.executeOnWindowsAndIgnoreError(ConsoleTasks.CliCommand.build(getAsAdminWindows()).
                values("multimode", "--file", deployCommands.toAbsolutePath().toString()));
        ConsoleTasks.executeOnUnixAndIgnoreError(ConsoleTasks.CliCommand.build(getAsAdminUnix()).
                values("multimode", "--file", deployCommands.toAbsolutePath().toString()));
    }

    private static final Logger LOGGER = Logger.getLogger(OpenEsbCLI.class);
View Full Code Here

        FileTasks.createFile(deployCommands, scriptContent);

        ConsoleTasks.executeOnWindowsAndIgnoreError(ConsoleTasks.CliCommand.build(getAsAdminWindows()).
                values("multimode", "--file", deployCommands.toAbsolutePath().toString()));
        ConsoleTasks.executeOnUnixAndIgnoreError(ConsoleTasks.CliCommand.build(getAsAdminUnix()).
                values("multimode", "--file", deployCommands.toAbsolutePath().toString()));
    }

    private static final Logger LOGGER = Logger.getLogger(OpenEsbCLI.class);
    private final Path glassfishHome;
}
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.