Package java.io

Examples of java.io.File.toPath()


              ArchiveStreamFactory.JAR, os)) {

        // If project is a war project add the war to the project
        if ("war".equalsIgnoreCase(project.getPackaging())) {
          File projectArtifact = project.getArtifact().getFile();
          if (projectArtifact != null && Files.exists(projectArtifact.toPath())) {
            aos.putArchiveEntry(new JarArchiveEntry(projectArtifact.getName()));
            try (InputStream is = Files.newInputStream(projectArtifact.toPath())) {
              IOUtils.copy(is, aos);
            }
            aos.closeArchiveEntry();
View Full Code Here


        // If project is a war project add the war to the project
        if ("war".equalsIgnoreCase(project.getPackaging())) {
          File projectArtifact = project.getArtifact().getFile();
          if (projectArtifact != null && Files.exists(projectArtifact.toPath())) {
            aos.putArchiveEntry(new JarArchiveEntry(projectArtifact.getName()));
            try (InputStream is = Files.newInputStream(projectArtifact.toPath())) {
              IOUtils.copy(is, aos);
            }
            aos.closeArchiveEntry();
          }
        }
View Full Code Here

              throw new MojoExecutionException(e.getMessage(), e);
            }

            File extraWarFile = result.getArtifact().getFile();
            aos.putArchiveEntry(new JarArchiveEntry(extraWarFile.getName()));
            try (InputStream is = Files.newInputStream(extraWarFile.toPath())) {
              IOUtils.copy(is, aos);
            }
            aos.closeArchiveEntry();

          }
View Full Code Here

                String dirName = f.toPath().getFileName().toString();
                String ver = isJavaDir(dirName);
                if (ver != null && (!jdk || isJDK(dirName))) {
                    File home = searchJavaHomeInDir(f);
                    if (home != null)
                        dirs.put(javaVersion(ver), home.toPath());
                }
            }
        }
        return !dirs.isEmpty() ? dirs : null;
    }
View Full Code Here

        else if(arguments != null && arguments.size() > 0) {
            File f = arguments.get(0);
            f = PathResolver.resolvePath(f, commandInvocation.getAeshContext().getCurrentWorkingDirectory()).get(0);
            if(f.isFile()) {
                if(color) {
                    String content = new String(Files.readAllBytes(f.toPath()));

                    ByteArrayOutputStream baos = new ByteArrayOutputStream();

                    Syntax.builtIns();
                    Syntax.Builder.create()
View Full Code Here

    private File createDirInAppbase(boolean withXml) throws IOException {
        File dir = new File(getTomcatInstance().getHost().getAppBaseFile(),
                APP_NAME.getBaseName());
        if (withXml) {
            recurrsiveCopy(DIR_XML_SOURCE.toPath(), dir.toPath());
        } else {
            recurrsiveCopy(DIR_SOURCE.toPath(), dir.toPath());
        }
        return dir;
    }
View Full Code Here

        File dir = new File(getTomcatInstance().getHost().getAppBaseFile(),
                APP_NAME.getBaseName());
        if (withXml) {
            recurrsiveCopy(DIR_XML_SOURCE.toPath(), dir.toPath());
        } else {
            recurrsiveCopy(DIR_SOURCE.toPath(), dir.toPath());
        }
        return dir;
    }

    private File createDirXmlInAppbase() throws IOException {
View Full Code Here

    }

    private File createDirXmlInAppbase() throws IOException {
        File dir = new File(getTomcatInstance().getHost().getAppBaseFile(),
                APP_NAME.getBaseName() + "/META-INF");
        recurrsiveCopy(DIR_XML_SOURCE_META_INF.toPath(), dir.toPath());
        return dir;
    }

    private File createDirInExternal(boolean withXml) throws IOException {
        File ext = new File(external, "external" + ".war");
View Full Code Here

    }

    private File createDirInExternal(boolean withXml) throws IOException {
        File ext = new File(external, "external" + ".war");
        if (withXml) {
            recurrsiveCopy(DIR_XML_SOURCE.toPath(), ext.toPath());
        } else {
            recurrsiveCopy(DIR_SOURCE.toPath(), ext.toPath());
        }
        return ext;
    }
View Full Code Here

    private File createDirInExternal(boolean withXml) throws IOException {
        File ext = new File(external, "external" + ".war");
        if (withXml) {
            recurrsiveCopy(DIR_XML_SOURCE.toPath(), ext.toPath());
        } else {
            recurrsiveCopy(DIR_SOURCE.toPath(), ext.toPath());
        }
        return ext;
    }

    private File createWar(File src, boolean useAppbase) throws IOException {
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.