Class UtilsResourcesCommons


  • public final class UtilsResourcesCommons
    extends java.lang.Object

    Class that provides functionality to control the close of resources.

    Project:

    Library for the integration with the services of @Firma, eVisor and TS@.

    Version:
    1.1, 18/04/2022.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getPropertiesName​(java.lang.String name)
      Method that obtains the name of properties file needed.
      static java.io.File getPropertiesResource​(java.lang.String propertiesFileName)
      Method that obtains properties as a file.
      static void safeCloseInputStream​(java.io.InputStream is)
      Method that handles the closing of a InputStream resource.
      static void safeCloseOutputStream​(java.io.OutputStream os)
      Method that handles the closing of a OutputStream resource.
      static void safeCloseSocket​(java.net.Socket socket)
      Method that handles the closing of a Socket resource.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • safeCloseInputStream

        public static void safeCloseInputStream​(java.io.InputStream is)
        Method that handles the closing of a InputStream resource.
        Parameters:
        is - Parameter that represents a InputStream resource.
      • safeCloseOutputStream

        public static void safeCloseOutputStream​(java.io.OutputStream os)
        Method that handles the closing of a OutputStream resource.
        Parameters:
        os - Parameter that represents a OutputStream resource.
      • safeCloseSocket

        public static void safeCloseSocket​(java.net.Socket socket)
        Method that handles the closing of a Socket resource.
        Parameters:
        socket - Parameter that represents a Socket resource.
      • getPropertiesName

        public static java.lang.String getPropertiesName​(java.lang.String name)
        Method that obtains the name of properties file needed.
        Parameters:
        name - Parameter that represents the properties file name mapping propertie.
        Returns:
        String as a name of properties file
      • getPropertiesResource

        public static java.io.File getPropertiesResource​(java.lang.String propertiesFileName)
                                                  throws java.net.URISyntaxException
        Method that obtains properties as a file.
        Parameters:
        propertiesFileName - Parameter that represents the properties file name.
        Returns:
        Properties as a file
        Throws:
        java.net.URISyntaxException - If the method fails.