public class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
readFromClasspath(String fileName)
Loads the content of a file in the class path into a String.
|
static String |
readFromFileSystem(String path)
Loads the content of the file identified by the given path in the file system.
|
static String |
readQuietlyFromClasspath(String fileName)
Loads the content of a file in the class path into a string.
|
public static String readFromClasspath(String fileName) throws IOException
fileName - the name of the file to be loadedIllegalArgumentException - it the file was not found in the class pathIOException - if an I/O error occurs reading the file from the streampublic static String readQuietlyFromClasspath(String fileName)
fileName - the name of the file to be loadedpublic static String readFromFileSystem(String path) throws IOException
path - the path to the fileIOException - if an I/O error occurs reading the file from the streamCopyright © 2023. All rights reserved.