public class FileUtils
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
FileUtils()
Private constructor that should never be called since this is a static
utility class.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(java.io.InputStream inputStream)
Closes the InputStream if it is not null, swallowing any exceptions.
|
static void |
closeQuietly(java.io.OutputStream outputStream)
Closes the OutputStream if it is not null, swallowing any exceptions.
|
static void |
closeQuietly(java.io.Reader reader)
Closes the Reader if it is not null, swallowing any exceptions.
|
static void |
closeQuietly(java.io.Writer writer)
Closes the Writer if it is not null, swallowing any exceptions.
|
static java.lang.String |
getFileExtension(java.lang.String file)
Returns the file extension without the '.' for the given filename, or
the empty string if the file has
no extension.
|
static java.lang.String |
getNameWithoutExtension(java.lang.String file)
Returns the filename without the extension or '.'.
|
private FileUtils()
public static java.lang.String getFileExtension(java.lang.String file)
file - the file to get the extension frompublic static java.lang.String getNameWithoutExtension(java.lang.String file)
file - the name of the file remove the extension frompublic static void closeQuietly(java.io.InputStream inputStream)
inputStream - the InputStream to closepublic static void closeQuietly(java.io.OutputStream outputStream)
outputStream - the OutputStream to closepublic static void closeQuietly(java.io.Reader reader)
reader - the Reader to closepublic static void closeQuietly(java.io.Writer writer)
writer - the Writer to close