Package java.nio.file

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


          }
          else
          {
            // a new file appeared. we need to clear the NOT_FOUND entry that may be added earlier.
            // MarkupCache keys are fully qualified URIs
            String absolutePath = eventPath.toAbsolutePath().toFile().toURI().toString();

            try
            {
              ThreadContext.setApplication(application);
              application.getMarkupSettings()
View Full Code Here


        // Create the storage area
        String dirName = (String) props.getProperty(Constants.RUNTIME_STORAGE_DIR);
        if (dirName == null) {
            Path storagePath = Paths.get(Constants.RUNTIME_STORAGE_DEFAULT);
            dirName = storagePath.toAbsolutePath().toString();
        }
        storageArea = new File(dirName);

        // Cleanup the storage area
        String storageClean = (String) props.getProperty(Constants.RUNTIME_STORAGE_CLEAN);
View Full Code Here

        if (expectedBootClasspath.size() > 0)
        {
            StringBuilder err = new StringBuilder();
            err.append("XBootClasspath mismatch between [files] and [exec]");
            err.append("\nThe following are inferred from your [files] definition in ");
            err.append(modFile.toAbsolutePath().toString());
            err.append("\nbut are not referenced in your [exec] section");
            for (String entry : expectedBootClasspath)
            {
                err.append("\n").append(entry);
            }
View Full Code Here

        }

        if (logFileName != null)
        {
            Path logfile = baseHome.getPath(logFileName);
            logfile = logfile.toAbsolutePath();
            initLogFile(logfile);
        }
    }

    public void initLogFile(Path logfile) throws IOException
View Full Code Here

                Path startLog = logfile;

                if (!FS.exists(startLog) && !FS.createNewFile(startLog))
                {
                    // Output about error is lost in majority of cases.
                    throw new UsageException(UsageException.ERR_LOGGING,new IOException("Unable to create: " + startLog.toAbsolutePath()));
                }

                if (!FS.canWrite(startLog))
                {
                    // Output about error is lost in majority of cases.
View Full Code Here

                }

                if (!FS.canWrite(startLog))
                {
                    // Output about error is lost in majority of cases.
                    throw new UsageException(UsageException.ERR_LOGGING,new IOException("Unable to write to: " + startLog.toAbsolutePath()));
                }

                err.println("StartLog to " + logfile);
                OutputStream fileout = Files.newOutputStream(startLog,StandardOpenOption.CREATE,StandardOpenOption.APPEND);
                PrintStream logger = new PrintStream(fileout);
View Full Code Here

            {
                this.outputDir = path;
            }
            else
            {
                LOG.warn("Unable to configure {}: not a valid output directory",path.toAbsolutePath().toString());
            }
        }

        String cfgPrefix = config.getParameter("prefix","frame");
        if (StringUtil.isNotBlank(cfgPrefix))
View Full Code Here

    {
        try
        {
            Path file = baseHome.getBasePath(farg.location);
           
            StartLog.debug("[init-file] %s module specified file %s",file.toAbsolutePath(),(FS.exists(file)?"[Exists!]":""));
            if (FS.exists(file))
            {
                // file already initialized / downloaded, skip it
                return;
            }
View Full Code Here

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

        this.path = path.toAbsolutePath();
        this.uri = path.toUri();
        this.alias = checkAliasPath(path);
    }

    public PathResource(URL url) throws IOException, URISyntaxException
View Full Code Here

        // Arbitrary Libs
        Path extraJar = MavenTestingUtils.getTestResourceFile("extra-libs/example.jar").toPath().normalize();
        Path extraDir = MavenTestingUtils.getTestResourceDir("extra-resources").toPath().normalize();
       
        extraJar = extraJar.toAbsolutePath();
        extraDir = extraDir.toAbsolutePath();
       
        assertThat("Extra Jar exists: " + extraJar,Files.exists(extraJar),is(true));
        assertThat("Extra Dir exists: " + extraDir,Files.exists(extraDir),is(true));
       
        StringBuilder lib = new StringBuilder();
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.