Package io.polyapi.plugin.service
Class FileServiceImpl
java.lang.Object
io.polyapi.plugin.service.FileServiceImpl
- All Implemented Interfaces:
FileService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateFileFromTemplate(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.polyapi.plugin.service.FileService
createClassFile, generateFile, generateFile
-
Constructor Details
-
FileServiceImpl
public FileServiceImpl()
-
-
Method Details
-
createFileFromTemplate
public void createFileFromTemplate(File file, String template, Object context, boolean overwriteFiles) Description copied from interface:FileServiceCreates a file, its parent directory and adds contents to it. The contents are created from a template and a context.- Specified by:
createFileFromTemplatein interfaceFileService- 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.
-
createFileWithContent
Description copied from interface:FileServiceCreates a file, its parent directory and adds contents to it.- Specified by:
createFileWithContentin interfaceFileService- Parameters:
file- TheFileto write.content- The contents of the file.overwriteFiles- Flag indicating if existing files should be overwritten.
-