Package java.nio.file

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


    Files.walkFileTree(testStoragePath, new SimpleFileVisitor<Path>() {
      @Override
      public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
        Path fileToCopy = copyTo.resolve(testStoragePath.relativize(file));
        if (fileToCopy.endsWith("baseLocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords.wmr"))
          fileToCopy = fileToCopy.getParent().resolve("testLocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords.wmr");
        else if (fileToCopy.endsWith("baseLocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords.0.wal"))
          fileToCopy = fileToCopy.getParent().resolve("testLocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords.0.wal");

        Files.copy(file, fileToCopy);
View Full Code Here


      @Override
      public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
        Path fileToCopy = copyTo.resolve(testStoragePath.relativize(file));
        if (fileToCopy.endsWith("baseLocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords.wmr"))
          fileToCopy = fileToCopy.getParent().resolve("testLocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords.wmr");
        else if (fileToCopy.endsWith("baseLocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords.0.wal"))
          fileToCopy = fileToCopy.getParent().resolve("testLocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords.0.wal");

        Files.copy(file, fileToCopy);

        return FileVisitResult.CONTINUE;
View Full Code Here

    private static final SimpleOption JDK8 = new SimpleOption("JDK8");

    @Override
    protected void process(StringBuilder sb, Context source, Context target, String template) {
        Path currentSourceFile = Generator.currentSourceFile();
        boolean packageInfo = currentSourceFile.endsWith("package-info.java") ||
                currentSourceFile.endsWith("html");
        if (JDK8.equals(target.getOption("jdk")) &&
                // Heuristic that we are at the end of the template class
                (template.trim().endsWith("}") || packageInfo)) {
            template = sb.toString() + template;
View Full Code Here

    @Override
    protected void process(StringBuilder sb, Context source, Context target, String template) {
        Path currentSourceFile = Generator.currentSourceFile();
        boolean packageInfo = currentSourceFile.endsWith("package-info.java") ||
                currentSourceFile.endsWith("html");
        if (JDK8.equals(target.getOption("jdk")) &&
                // Heuristic that we are at the end of the template class
                (template.trim().endsWith("}") || packageInfo)) {
            template = sb.toString() + template;
            // in ordinary Java source files, we replace only imports, to let fully-qualified refs
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.