Package java.nio.file

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


            cache = getCacheHome().resolve((isWindows() ? "" : ".") + cacheName);
        }
        try {
            if (!Files.exists(cache))
                Files.createDirectory(cache);
            if (!Files.exists(cache.resolve(APP_CACHE_NAME)))
                Files.createDirectory(cache.resolve(APP_CACHE_NAME));
            if (!Files.exists(cache.resolve(DEPS_CACHE_NAME)))
                Files.createDirectory(cache.resolve(DEPS_CACHE_NAME));

            return cache;
View Full Code Here


        }
        try {
            if (!Files.exists(cache))
                Files.createDirectory(cache);
            if (!Files.exists(cache.resolve(APP_CACHE_NAME)))
                Files.createDirectory(cache.resolve(APP_CACHE_NAME));
            if (!Files.exists(cache.resolve(DEPS_CACHE_NAME)))
                Files.createDirectory(cache.resolve(DEPS_CACHE_NAME));

            return cache;
        } catch (IOException e) {
View Full Code Here

        try {
            if (!Files.exists(cache))
                Files.createDirectory(cache);
            if (!Files.exists(cache.resolve(APP_CACHE_NAME)))
                Files.createDirectory(cache.resolve(APP_CACHE_NAME));
            if (!Files.exists(cache.resolve(DEPS_CACHE_NAME)))
                Files.createDirectory(cache.resolve(DEPS_CACHE_NAME));

            return cache;
        } catch (IOException e) {
            throw new RuntimeException("Error opening cache directory " + cache.toAbsolutePath(), e);
View Full Code Here

            if (!Files.exists(cache))
                Files.createDirectory(cache);
            if (!Files.exists(cache.resolve(APP_CACHE_NAME)))
                Files.createDirectory(cache.resolve(APP_CACHE_NAME));
            if (!Files.exists(cache.resolve(DEPS_CACHE_NAME)))
                Files.createDirectory(cache.resolve(DEPS_CACHE_NAME));

            return cache;
        } catch (IOException e) {
            throw new RuntimeException("Error opening cache directory " + cache.toAbsolutePath(), e);
        }
View Full Code Here

                LOGGER.warn("**WARNING** you're running with a custom JRE, at your own risk");
                String path = expand(metadata.getRuntimeParameter("java", "home"));
                javaHome = FileSystems.getDefault().getPath(path);

                Files2.chmodAddReadExecute(javaHome.resolve("bin"));
                break;
            default:
                throw new RuntimeException("Unsupported java version "+javaVersion);
        }

View Full Code Here

    }

    protected void setupDomain(final File template) {
        // Setup the domain according to the setup script
        Path templatePath = template.toPath();
        File setupScript = templatePath.resolve(DOMAIN_SETUP_SCRIPT).toFile();
        if (setupScript.isFile()) {
            ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");
            // Fallback
            if (engine == null) {
                engine = new ScriptEngineManager().getEngineByExtension("js");
View Full Code Here

            if (engine != null) {
                logger.log(Level.CONFIG, "Processing domain setup script " + DOMAIN_SETUP_SCRIPT);
                Bindings bindings = engine.createBindings();
                bindings.put("server", this);
                bindings.put("templatePath", templatePath.toString());
                bindings.put("templateApplicationsPath", templatePath.resolve(DOMAIN_TEMPLATE_APPLICATIONS_DIR).toString());
                engine.setBindings(bindings, ScriptContext.ENGINE_SCOPE);

                FileReader fr = null;
                try {
                    fr = new FileReader(setupScript);
View Full Code Here

        String symbolicName = resid.getSymbolicName();
        Version version = resid.getVersion();

        // copy resource content
        Path catalinaLib = runtime.getCatalinaHome().resolve("lib");
        final File targetFile = catalinaLib.resolve(symbolicName + "-" + version + ".jar").toFile();
        if (targetFile.exists()) {
            LOGGER.warn("Module already exists: " + targetFile);
        } else {
            ResourceContent content = getFirstRelevantResourceContent(resource);
            IOUtils.copyStream(content.getContent(), new FileOutputStream(targetFile));
View Full Code Here

        Path catalinaTemp = runtime.getCatalinaHome().resolve("temp");
        ContentCapability ccap = (ContentCapability) resource.getCapabilities(ContentNamespace.CONTENT_NAMESPACE).get(0);
        URL contentURL = ccap.getContentURL();
        if (contentURL == null || !contentURL.toExternalForm().startsWith("file:")) {
            ResourceContent content = getFirstRelevantResourceContent(resource);
            tempfile = catalinaTemp.resolve(runtimeName).toFile();
            IOUtils.copyStream(content.getContent(), new FileOutputStream(tempfile));
            contentURL = tempfile.toURI().toURL();
        }

        // Get contextPath, username, password
View Full Code Here

        for (WatchEvent<?> event : key.pollEvents()) {
          if (event.kind() == StandardWatchEventKinds.OVERFLOW) {
            continue;
          }
          WatchEvent<Path> ev = (WatchEvent<Path>) event;
          if(dir.resolve(ev.context()).equals(inputPath)) {
            generate();
          }
        }
        valid = key.reset();
      }
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.