restdocs.tool.export.common.utils.RestDocsFileUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of restdocs-tool-export Show documentation
Show all versions of restdocs-tool-export Show documentation
Generates AsciiDoc snippets via Spring Restdocs that are exports for Insomnia or Postman that can be download and imported.
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