Class FileModel

All Implemented Interfaces:
Model

public class FileModel extends ContentModel
  • Constructor Details

  • Method Details

    • getContent

      public String getContent()
    • setContent

      public void setContent(String content)
    • getFileType

      public FileType getFileType()
    • setFileType

      public void setFileType(FileType fileType)
    • getRandomFileModel

      public static FileModel getRandomFileModel(FileType fileType)
      Generates a new random FileModel object
    • getRandomFileModel

      public static FileModel getRandomFileModel(FileType fileType, String content)
      Generates a new random FileModel object with content
    • toFile

      public File toFile()
    • getFileModelBasedOnTestDataFile

      public static FileModel getFileModelBasedOnTestDataFile(String resourceDataFile)
      This will generate a new FileModel having one existing file from src/main/resources/shared-data location
      Parameters:
      resourceDataFile -
      Returns:
      Throws:
      IORuntimeException - if the file cannot be read.
    • cloneAsWorkingCopy

      public FileModel cloneAsWorkingCopy()
      Clone file model to working copy. (e.g. 'test.txt' to 'test (Working Copy).txt' )
      Returns:
      FileModel
    • getFileModelWithContentSizeOfxMB

      public static FileModel getFileModelWithContentSizeOfxMB(int size)
      Create a FileModel with content size of MB e.g.: getFileModelWithContentSizeOfxMB(1) will return a FileModel with a content of 1 MB