Class FileGenerator


  • public class FileGenerator
    extends java.lang.Object
    A static access class that creates files on the OS
    • Constructor Summary

      Constructors 
      Constructor Description
      FileGenerator()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.nio.file.Path generateFile​(java.lang.String parentDirectory, java.lang.String fileName, int lengthInBytes)
      Generates a file at the specified location
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileGenerator

        public FileGenerator()
    • Method Detail

      • generateFile

        public static java.nio.file.Path generateFile​(java.lang.String parentDirectory,
                                                      java.lang.String fileName,
                                                      int lengthInBytes)
                                               throws java.io.FileNotFoundException,
                                                      java.io.IOException
        Generates a file at the specified location
        Parameters:
        parentDirectory - Directory where you would like to create the file
        fileName - Name of the file to be created
        lengthInBytes - Length of the file in bytes
        Returns:
        Java NIO Path object representing the file
        Throws:
        java.io.FileNotFoundException - Thrown if the generation operation fails
        java.io.IOException - Thrown if the generation operation fails