All Downloads are FREE. Search and download functionalities are using the official Maven repository.

restdocs.tool.export.common.utils.RestDocsFileUtils Maven / Gradle / Ivy

Go to download

Generates AsciiDoc snippets via Spring Restdocs that are exports for Insomnia or Postman that can be download and imported.

There is a newer version: 0.0.6-RELEASE
Show newest version
package restdocs.tool.export.common.utils;

import java.io.File;
import java.io.IOException;

public class RestDocsFileUtils {

  private RestDocsFileUtils() {}

  public static File createToolDirectory(File workingDirectory, String toolName) {
    File file = new File(workingDirectory.getAbsolutePath() + "/" + toolName.toLowerCase() + "-download");
    file.mkdir();

    return file;
  }

  public static File initToolFile(File implDir, String fileEnding, String toolName) throws IOException {
    File file = new File(implDir.getAbsoluteFile() + "/" + toolName.toLowerCase() + fileEnding);

    if(!file.exists()) {
      file.createNewFile();
    } else {
      file.delete();
      file.createNewFile();
    }

    return file;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy