Package io.polyapi.plugin.service
Interface FileService
- All Known Implementing Classes:
FileServiceImpl
public interface FileService
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcreateClassFile(String classPackage, String className, String template, Object context, boolean overwriteFiles) voidcreateFileFromTemplate(File file, String template, Object context, boolean overwriteFiles) Creates a file, its parent directory and adds contents to it.voidcreateFileWithContent(File file, String content, boolean overwriteFiles) Creates a file, its parent directory and adds contents to it.default voidgenerateFile(Generable generable, boolean overwriteFiles) default voidgenerateFile(Generable generable, String template, boolean overwriteFiles)
-
Method Details
-
generateFile
-
generateFile
-
createClassFile
-
createFileWithContent
Creates a file, its parent directory and adds contents to it.- Parameters:
file- TheFileto write.content- The contents of the file.overwriteFiles- Flag indicating if existing files should be overwritten.
-
createFileFromTemplate
Creates a file, its parent directory and adds contents to it. The contents are created from a template and a context.- Parameters:
file- TheFileto write.template- The name of the template of the content of the file.context- The context which, provided to the template, will form the content of the file.overwriteFiles- Flag indicating if existing files should be overwritten.
-