Package es.gob.afirma.utils
Class UtilsResourcesCommons
- java.lang.Object
-
- es.gob.afirma.utils.UtilsResourcesCommons
-
public final class UtilsResourcesCommons extends java.lang.ObjectClass 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.StringgetPropertiesName(java.lang.String name)Method that obtains the name of properties file needed.static java.io.FilegetPropertiesResource(java.lang.String propertiesFileName)Method that obtains properties as a file.static voidsafeCloseInputStream(java.io.InputStream is)Method that handles the closing of aInputStreamresource.static voidsafeCloseOutputStream(java.io.OutputStream os)Method that handles the closing of aOutputStreamresource.static voidsafeCloseSocket(java.net.Socket socket)Method that handles the closing of aSocketresource.
-
-
-
Method Detail
-
safeCloseInputStream
public static void safeCloseInputStream(java.io.InputStream is)
Method that handles the closing of aInputStreamresource.- Parameters:
is- Parameter that represents aInputStreamresource.
-
safeCloseOutputStream
public static void safeCloseOutputStream(java.io.OutputStream os)
Method that handles the closing of aOutputStreamresource.- Parameters:
os- Parameter that represents aOutputStreamresource.
-
safeCloseSocket
public static void safeCloseSocket(java.net.Socket socket)
Method that handles the closing of aSocketresource.- Parameters:
socket- Parameter that represents aSocketresource.
-
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.URISyntaxExceptionMethod 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.
-
-