Java Path Create nio createFileForReport(Path reportDir, String filePrefix, String fileSuffix)

Here you can find the source of createFileForReport(Path reportDir, String filePrefix, String fileSuffix)

Description

create File For Report

License

LGPL

Declaration

public static Path createFileForReport(Path reportDir, String filePrefix, String fileSuffix) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.nio.file.*;

public class Main {
    public static Path createFileForReport(Path reportDir, String filePrefix, String fileSuffix) {
        Path reportFile = reportDir.resolve(filePrefix + "_validation_result." + fileSuffix);

        for (int i = 1; Files.exists(reportFile); i++) {
            reportFile = reportDir.resolve(filePrefix + "(" + i + ")_validation_result." + fileSuffix);
        }//from w  ww  .j  av  a2s . c  o m

        return reportFile;
    }
}

Related

  1. createFile(Path path)
  2. createFile(Path path)
  3. createFile(Path path)
  4. createFile(String filePath, String content)
  5. createFile(String workspacePath)
  6. createFileFromText(String sourceText, IPath path)
  7. createFileIfNotExist(Path path)
  8. createFileIfNotExists(Path path)
  9. createFileRelativeToClasspath(String resourceName)