Class ReadMyFile

java.lang.Object
it.ramecera.salad.file.ReadMyFile

public class ReadMyFile
extends java.lang.Object

Class for reading files. The class should not be instantiated.

Company: Rameceraâ„¢
Creation date: 2020-04-09

Changes:

Author:
M. Maglioni
  • Constructor Summary

    Constructors 
    Constructor Description
    ReadMyFile()  
  • Method Summary

    Modifier and Type Method Description
    static java.util.List<java.lang.String> listaFile​(java.lang.String x, java.lang.String y)
    Production of the list of files of a directory, filtered according to a pattern.
    static java.util.List<java.lang.String> zebra_A​(java.io.File f)
    As above, but the input provided is a File object.
    static java.util.List<java.lang.String> zebra_A​(java.lang.String g)
    Reading a sequential file.
    static java.util.List<java.lang.String> zebra_B​(java.lang.String g)
    Reading a sequential file.
    static java.util.List<java.lang.String> zebra_C​(java.io.File file, java.lang.String code)
    Reading a sequential file.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • zebra_A

      public static java.util.List<java.lang.String> zebra_A​(java.lang.String g) throws java.io.IOException, java.io.FileNotFoundException

      Reading a sequential file. It is intended as structured with lines terminated by CR / LF or LF; the method reads the lines on a List of strings.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Parameters:
      g - file name, complete with path
      Returns:
      a List of strings
      Throws:
      java.io.FileNotFoundException - is triggered when the file does not exist
      java.io.IOException - is triggered when it is not possible to read, for any other reason
    • zebra_B

      public static java.util.List<java.lang.String> zebra_B​(java.lang.String g) throws java.io.IOException, java.io.FileNotFoundException

      Reading a sequential file. It is intended as structured with lines terminated by CR / LF or LF; the method reads the lines on a List of strings. It differs from zebra_A in that it ignores empty lines, which therefore do not weigh down the list.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Parameters:
      g - file name, complete with path
      Returns:
      a List of strings
      Throws:
      java.io.FileNotFoundException - is triggered when the file does not exist
      java.io.IOException - is triggered when it is not possible to read, for any other reason
    • zebra_C

      public static java.util.List<java.lang.String> zebra_C​(java.io.File file, java.lang.String code) throws ExactException

      Reading a sequential file. It is intended as structured with lines terminated by CR/LF or LF; the method reads the lines on a list of strings.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Parameters:
      file - the object File to be read
      code - Unicode code to be adopted
      Returns:
      a List of strings
      Throws:
      ExactException - standard exception
    • zebra_A

      public static java.util.List<java.lang.String> zebra_A​(java.io.File f) throws java.io.IOException, java.io.FileNotFoundException

      As above, but the input provided is a File object.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Parameters:
      f - the file object
      Returns:
      a List of strings
      Throws:
      java.io.FileNotFoundException - is triggered when the file does not exist
      java.io.IOException - is triggered when it is not possible to read, for any other reason
    • listaFile

      public static java.util.List<java.lang.String> listaFile​(java.lang.String x, java.lang.String y)

      Production of the list of files of a directory, filtered according to a pattern.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      x - the pattern to filter the files, according to the codes of the java.util.regex.Pattern class.
      y - the path to search for
      Returns:
      an array list of strings with the found files
      Since:
      1.0.0 files