Class FileUtil
- java.lang.Object
-
- com.github.toolarium.security.util.FileUtil
-
public final class FileUtil extends java.lang.ObjectFile Util class
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileUtilgetInstance()Get the instancejava.lang.StringreadFileContent(java.io.File file)Read the file contentjava.lang.StringreadFileContent(java.io.File file, java.nio.charset.Charset charset)Read the file contentjava.lang.StringreadFileContent(java.nio.file.Path file)Read the file contentjava.lang.StringreadFileContent(java.nio.file.Path file, java.nio.charset.Charset charset)Read the file content
-
-
-
Method Detail
-
getInstance
public static FileUtil getInstance()
Get the instance- Returns:
- the instance
-
readFileContent
public java.lang.String readFileContent(java.io.File file) throws java.io.IOExceptionRead the file content- Parameters:
file- the file- Returns:
- the content
- Throws:
java.io.IOException- In case of an IO error
-
readFileContent
public java.lang.String readFileContent(java.nio.file.Path file) throws java.io.IOExceptionRead the file content- Parameters:
file- the file- Returns:
- the content
- Throws:
java.io.IOException- In case of an IO error
-
readFileContent
public java.lang.String readFileContent(java.io.File file, java.nio.charset.Charset charset) throws java.io.IOExceptionRead the file content- Parameters:
file- the filecharset- the charset- Returns:
- the content
- Throws:
java.io.IOException- In case of an IO error
-
readFileContent
public java.lang.String readFileContent(java.nio.file.Path file, java.nio.charset.Charset charset) throws java.io.IOExceptionRead the file content- Parameters:
file- the filecharset- the charset- Returns:
- the content
- Throws:
java.io.IOException- In case of an IO error
-
-