Package files

Class TxtFile

  • All Implemented Interfaces:
    ParseableFile<java.lang.String>

    public class TxtFile
    extends java.lang.Object
    implements ParseableFile<java.lang.String>
    The main goal of this class is to get the content inside a txt file, in addition to represent a txtFile, to make it explicit.
    Since:
    1.0 SNAPSHOT
    Author:
    Arthur Brenno
    • Constructor Summary

      Constructors 
      Constructor Description
      TxtFile​(@NotNull java.nio.file.Path path)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContent()
      This method returns the content of the txt.
      java.nio.file.Path path()  
      • Methods inherited from class java.lang.Object

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

      • TxtFile

        public TxtFile​(@NotNull
                       @NotNull java.nio.file.Path path)
                throws java.lang.IllegalArgumentException
        Constructor.
        Parameters:
        path - to the txt file.
        Throws:
        java.lang.IllegalArgumentException - if the file is not a txt.
    • Method Detail

      • getContent

        public java.lang.String getContent()
                                    throws java.io.IOException
        This method returns the content of the txt.
        Specified by:
        getContent in interface ParseableFile<java.lang.String>
        Returns:
        String with the content of the txt.
        Throws:
        java.io.IOException - if the file is not found.
      • path

        public java.nio.file.Path path()