Class FileServiceImpl

java.lang.Object
io.polyapi.plugin.service.FileServiceImpl
All Implemented Interfaces:
FileService

public class FileServiceImpl extends Object implements FileService
  • Constructor Details

    • FileServiceImpl

      public FileServiceImpl()
  • Method Details

    • createFileFromTemplate

      public void createFileFromTemplate(File file, String template, Object context, boolean overwriteFiles)
      Description copied from interface: FileService
      Creates a file, its parent directory and adds contents to it. The contents are created from a template and a context.
      Specified by:
      createFileFromTemplate in interface FileService
      Parameters:
      file - The File to 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

      public void createFileWithContent(File file, String content, boolean overwriteFiles)
      Description copied from interface: FileService
      Creates a file, its parent directory and adds contents to it.
      Specified by:
      createFileWithContent in interface FileService
      Parameters:
      file - The File to write.
      content - The contents of the file.
      overwriteFiles - Flag indicating if existing files should be overwritten.