Class Equipment

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

public class Equipment
extends java.lang.Object

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

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

Changes:
2020-04-09: various methods added 2020-04-09: modification of unicaStringaUnicode_B and creation of entities_A

Author:
M. Maglioni
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static char LF
    char Line Feed
    static java.lang.String LFS
    Line Feed font
  • Constructor Summary

    Constructors 
    Constructor Description
    Equipment()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String entities_A​(java.lang.String t)
    String-to-string transformation, using XML-character .
    By ffff we mean 4 hexadecimal characters, for example: e445, 00fe, ff4a, etc. which correspond to 16 bits.
    The code is regulated by W3C production [66].
    static java.lang.String entities_A​(java.lang.String t, int h)
    Variant of the previous one, it only makes the amount of heap memory required by the JVM variable.
    static java.lang.String entities_C​(java.lang.String t)
    String-to-string transformation, using XML-character .
    By ffff we mean 4 hexadecimal characters, for example: e445, 00fe, ff4a, etc. . which correspond to 16 bits.
    The code is regulated by W3C production [66].
    Version perfected compared to entities_A.
    static java.lang.String entities_C​(java.lang.String t, int limit)
    String-to-string transformation, using XML-character .
    By ffff we mean 4 hexadecimal characters, for example: e445, 00fe, ff4a, etc. . which correspond to 16 bits.
    The code is regulated by W3C production [66].
    Version perfected compared to entities_A.
    static java.lang.String entities_Z​(java.lang.String s)
    Transformation of a text containing hexadecimal character reference into an ordinary 16-bit string per character; the code is regulated by W3C production [66].
    static java.lang.String oneString​(java.io.File file)
    Reading a sequential file to deposit it on a single string.
    static java.lang.String oneString​(java.lang.String g)
    Overload of the previous method.
    static java.lang.String oneStringUnicode_A​(java.io.File file, java.lang.String code)
    Reading of a sequential file to deposit it on a single string, with transformation in UTF.
    static java.lang.String oneStringUnicode_A​(java.lang.String f, java.lang.String code)
    Reading of a sequential file to deposit it on a single string, with transformation in UTF.
    static void scriviFileDaStringa​(java.io.File file, java.lang.String s)
    Writing a sequential file starting from the text of a string.
    static void scriviFileDaStringaUnicode_B​(java.io.File file, java.lang.String s, java.lang.String code)
    Writing a sequential file starting from the text of a string, with transformation in UTF-16 and use of XML character-entity .
    The code is regulated by W3C production [66].
    static void scriviFileVuoto​(java.io.File file)
    Writing an empty file; if it already exists, empty or full, the method does nothing; if èd is a directory, the method does nothing.
    static void scriviFileVuoto​(java.lang.String s)
    Overload of the previous one.
    static void scriviZipEntry​(java.util.zip.ZipFile z, java.util.zip.ZipEntry ze, java.io.File output, java.lang.String code)
    Writing a file extracted from a zip, assuming the presence of Unicode characters.
    static boolean surgery​(java.lang.String dY, java.lang.String f, java.lang.String x, java.lang.String y, org.apache.log4j.Logger logger)
    Creation date: 2020-10-06
    Class: Sweat
    static java.lang.String unicaStringa​(java.io.InputStream is)
    Overload of the previous method.
    static java.lang.String unicaStringaUnicode_B​(java.io.File file, java.lang.String code)
    Reading of a sequential file to deposit it on a single string, with transformation into UTF and use of XML-character .
    By ffff we mean 4 hexadecimal characters, example : e445, 00fe, ff4a, etc. which correspond to 16 bits.
    The code is regulated by the production [66] of the W3C.
    The file is fully deposited, for example the CR and / or LF are inserted exactly like all the other characters.
    static java.lang.String unicaStringaUnicode_B​(java.io.InputStream is, java.lang.String code)
    Overload of the previous method.
    static boolean writeFileFromOneString_economy​(java.io.File file, java.lang.String s)
    Writing a sequential file starting from the text of a string.
    static void writeFileFromOneStringUnicode_A​(java.io.File file, java.lang.String s, java.lang.String code)
    Writing a sequential file starting from the text of a string, with transformation in UTF.

    Methods inherited from class java.lang.Object

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

    • LF

      public static final char LF
      char Line Feed
      See Also:
      Constant Field Values
    • LFS

      public static final java.lang.String LFS
      Line Feed font
  • Constructor Details

  • Method Details

    • oneString

      public static java.lang.String oneString​(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException

      Reading a sequential file to deposit it on a single string. The file is fully deposited, for example the CR and/or LF are inserted exactly like all the other characters.

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

      Changes:

      Parameters:
      file - input file
      Returns:
      string with the entire contents of the
      Throws:
      java.io.FileNotFoundException - is triggered when the file does not exist
      java.io.IOException - is triggered when it cannot be read, for any other reason.
    • oneString

      public static java.lang.String oneString​(java.lang.String g) throws java.io.IOException, java.io.FileNotFoundException

      Overload of the previous method.

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

      Changes:

      Parameters:
      g - file name, including all path
      Returns:
      the all-inclusive string of all text
      Throws:
      java.io.IOException - ordinary exception
      java.io.FileNotFoundException - ordinary exception
      Since:
      1.0.0 - SVutensiliJ4_1.3.0
    • unicaStringa

      public static java.lang.String unicaStringa​(java.io.InputStream is) throws java.io.IOException, java.io.FileNotFoundException

      Overload of the previous method.

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

      Changes:

      Parameters:
      is - the InputStream object to read
      Returns:
      the all-inclusive string of all text
      Throws:
      java.io.IOException - ordinary exception
      java.io.FileNotFoundException - ordinary exception
      Since:
      3
    • oneStringUnicode_A

      public static java.lang.String oneStringUnicode_A​(java.io.File file, java.lang.String code) throws ExactException

      Reading of a sequential file to deposit it on a single string, with transformation in UTF. The file is fully deposited, for example the CR and/or LF are inserted exactly like all the other characters.

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

      Changes:

      Parameters:
      file - input file
      code - code to be adopted
      Returns:
      string with the entire contents of the file
      Throws:
      ExactException - standard exception
    • oneStringUnicode_A

      public static java.lang.String oneStringUnicode_A​(java.lang.String f, java.lang.String code) throws ExactException

      Reading of a sequential file to deposit it on a single string, with transformation in UTF. Overload of the previous one.

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

      Changes:

      Parameters:
      f - input file
      code - code to be adopted
      Returns:
      string with the entire contents of the file
      Throws:
      ExactException - standard exception
    • unicaStringaUnicode_B

      public static java.lang.String unicaStringaUnicode_B​(java.io.File file, java.lang.String code) throws java.io.UnsupportedEncodingException, java.io.IOException

      Reading of a sequential file to deposit it on a single string, with transformation into UTF and use of XML-character .
      By ffff we mean 4 hexadecimal characters, example : e445, 00fe, ff4a, etc. which correspond to 16 bits.
      The code is regulated by the production [66] of the W3C.
      The file is fully deposited, for example the CR and / or LF are inserted exactly like all the other characters.

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

      Modifications:
      29/12 08: extraction of part of the argorithm in the new entities_A method.
      2020-04-09: replacement of the entities_A method with entities_B, to avoid saturation of the heap

      Parameters:
      file - input file
      code - code to be adopted
      Returns:
      string with l the entire contents of the
      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.
      java.io.UnsupportedEncodingException - UTF codes do not exist in that combination
      Since:
      2.0.0 - SVutensiliJ4_1.3.0
    • unicaStringaUnicode_B

      public static java.lang.String unicaStringaUnicode_B​(java.io.InputStream is, java.lang.String code) throws java.io.UnsupportedEncodingException, java.io.IOException

      Overload of the previous method.

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

      Changes:

      Parameters:
      is - the InputStream object to be read
      code - encoding UNICODE
      Returns:
      the all-inclusive string of all text
      Throws:
      java.io.UnsupportedEncodingException - ordinary exception
      java.io.IOException - ordinary exception
      java.io.FileNotFoundException - ordinary exception
      Since:
      3
    • entities_A

      public static java.lang.String entities_A​(java.lang.String t)

      String-to-string transformation, using XML-character .
      By ffff we mean 4 hexadecimal characters, for example: e445, 00fe, ff4a, etc. which correspond to 16 bits.
      The code is regulated by W3C production [66].

      Creation date: 2020-04-09
      Last updated: 29 / 04/08

      Changes:

      Parameters:
      t - input string
      Returns:
      oputput string
    • entities_A

      public static java.lang.String entities_A​(java.lang.String t, int h)

      Variant of the previous one, it only makes the amount of heap memory required by the JVM variable. This variant was introduced because the multiplier 8 in the new char of the original version of the method was excessive when applying the method to an entire file, corrected when applying to a simple sentence, as happens in the justify_A method of the class it.ipzs.utensiliJN .comuni.Giustificazione. The multiplier becomes a topic of the method.

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

      Changes:

      Parameters:
      t - input string
      h - multiplier to decide how much heap memory space to take
      Returns:
      oputput string
      Since:
      3.0.0 - SVutensiliJ4_2.0.0
    • entities_C

      public static java.lang.String entities_C​(java.lang.String t)

      String-to-string transformation, using XML-character .
      By ffff we mean 4 hexadecimal characters, for example: e445, 00fe, ff4a, etc. . which correspond to 16 bits.
      The code is regulated by W3C production [66].
      Version perfected compared to entities_A.

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

      Changes:

      Parameters:
      t - input string
      Returns:
      oputput string
      Since:
      3.0.0 - SVutensiliJ4_2.0.0
    • entities_C

      public static java.lang.String entities_C​(java.lang.String t, int limit)

      String-to-string transformation, using XML-character .
      By ffff we mean 4 hexadecimal characters, for example: e445, 00fe, ff4a, etc. . which correspond to 16 bits.
      The code is regulated by W3C production [66].
      Version perfected compared to entities_A.

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

      Changes:

      Parameters:
      t - input string
      limit - limit beyond which the input transformation is triggered
      Returns:
      oputput string
      Since:
      3.0.0 - SVutensiliJ4_2.0.0
    • entities_Z

      public static java.lang.String entities_Z​(java.lang.String s)

      Transformation of a text containing hexadecimal character reference into an ordinary 16-bit string per character; the code is regulated by W3C production [66].

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

      Changes:

      Parameters:
      s - string to be written
      Returns:
      the Unicode string
      Since:
      SVutensiliJ4_1.3.0
    • scriviFileDaStringa

      public static void scriviFileDaStringa​(java.io.File file, java.lang.String s) throws ExactException

      Writing a sequential file starting from the text of a string.

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

      Changes:

      Parameters:
      file - output file
      s - string to write
      Throws:
      ExactException - is triggered when the directory does not exist, or the file cannot be written
    • writeFileFromOneString_economy

      public static boolean writeFileFromOneString_economy​(java.io.File file, java.lang.String s) throws ExactException

      Writing a sequential file starting from the text of a string. It differs from the writeFileFromStringa method because if everything is already exactly written it does nothing.

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

      Changes:

      Parameters:
      file - input file
      s - string to write false
      Returns:
      if the file was not written, for economy, being already present and identical; true if
      Throws:
      ExactException - is triggered when the directory does not exist, or it is not possible to write to the file
    • writeFileFromOneStringUnicode_A

      public static void writeFileFromOneStringUnicode_A​(java.io.File file, java.lang.String s, java.lang.String code) throws ExactException

      Writing a sequential file starting from the text of a string, with transformation in UTF.

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

      Changes:

      Parameters:
      file - output file
      s - string to be written
      code - Unicode code to be adopted
      Throws:
      ExactException - is triggered when the directory does not exist, or it is not possible to write to the file
    • scriviFileDaStringaUnicode_B

      public static void scriviFileDaStringaUnicode_B​(java.io.File file, java.lang.String s, java.lang.String code) throws ExactException

      Writing a sequential file starting from the text of a string, with transformation in UTF-16 and use of XML character-entity .
      The code is regulated by W3C production [66].

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

      Changes:

      Parameters:
      file - output file
      s - string to be written
      code - Unicode code to be adopted
      Throws:
      ExactException - is triggered when the directory does not exist, or it is not possible to write to the file
    • scriviZipEntry

      public static void scriviZipEntry​(java.util.zip.ZipFile z, java.util.zip.ZipEntry ze, java.io.File output, java.lang.String code) throws ExactException, java.io.IOException

      Writing a file extracted from a zip, assuming the presence of Unicode characters.

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

      Changes:

      Parameters:
      z - the zip file
      ze - entry (i.e. internal element) of the zip file
      output - output file
      code - the type of encoding Unicode
      Throws:
      ExactException - is triggered when the directory does not exist, or it is not possible to write to the file
      java.io.IOException - standard exception
      Since:
      3
    • scriviFileVuoto

      public static void scriviFileVuoto​(java.io.File file) throws ExactException

      Writing an empty file; if it already exists, empty or full, the method does nothing; if èd is a directory, the method does nothing.

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

      Changes:

      Parameters:
      file - the file to be created
      Throws:
      ExactException - is triggered when the file cannot be written, for example because the path is wrong.
    • scriviFileVuoto

      public static void scriviFileVuoto​(java.lang.String s) throws ExactException

      Overload of the previous one.

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

      Changes:

      Parameters:
      s - the file to be created
      Throws:
      ExactException - is triggered when the file cannot be written, for example because the path is wrong.
    • surgery

      public static boolean surgery​(java.lang.String dY, java.lang.String f, java.lang.String x, java.lang.String y, org.apache.log4j.Logger logger)

      Creation date: 2020-10-06
      Class: Sweat

      Description: this method read a file, modify one time the corresponding string, finally write it.

      Parameters:
      dY - directory
      f - name of the file to be modified
      x - regular expression
      y - replacement