FileWriter

In package com.cdsap.talaiot.writer

class com.cdsap.talaiot.writer.FileWriter

I/O contract related to files

Fields

abstract var project:

Gradle Project used to retrieve the extension

abstract var logTracker: LogTracker

LogTracker to print in console depending on the Mode

Methods

abstract fun prepareFile(content: Any, name: String)

Previous step where it will invoke the creation of the file depending on the Publisher and the way we want to write on disk

Parameters:
  • content: Any

    it contains the data formatted to be persisted. The implementation gives the specific type

  • name: String

    filename

open fun createFile(func: ()->Unit)

perform the operation of creating a file and write the content independent of the Publisher

Parameters:
  • func: ()->Unit

    lambda to be executed after the file is created. Depending on the implementation of the FileWriter the function will be different

open fun dirExist(): Boolean
Parameters:
  • No parameters