org.pdfsam.guiclient.utils
Class FileExtensionUtility
java.lang.Object
org.pdfsam.guiclient.utils.FileExtensionUtility
public final class FileExtensionUtility
- extends java.lang.Object
Utility class for the file extensions related tasks
- Author:
- Andrea Vacondio
Method Summary |
static java.io.File |
ensureExtension(java.io.File file,
java.lang.String fileExtension)
Ensures that the file in input has the input file extension, if not it
adds the extension. |
static java.lang.String |
ensureExtension(java.lang.String filePath,
java.lang.String fileExtension)
Ensures that the file path in input has the input file extension, if not
it adds the extension. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PDF_EXTENSION
public static final java.lang.String PDF_EXTENSION
- See Also:
- Constant Field Values
XML_EXTENSION
public static final java.lang.String XML_EXTENSION
- See Also:
- Constant Field Values
TXT_EXTENSION
public static final java.lang.String TXT_EXTENSION
- See Also:
- Constant Field Values
ensureExtension
public static java.lang.String ensureExtension(java.lang.String filePath,
java.lang.String fileExtension)
- Ensures that the file path in input has the input file extension, if not
it adds the extension.
- Parameters:
filePath
- fileExtension
- the file extension without leading dot (Ex. pdf)
- Returns:
- the correct file path (with file extension added if necessasy)
ensureExtension
public static java.io.File ensureExtension(java.io.File file,
java.lang.String fileExtension)
- Ensures that the file in input has the input file extension, if not it
adds the extension.
- Parameters:
file
- fileExtension
- the file extension without leading dot (Ex. pdf)
- Returns:
- the correct file path (with file extension added if necessasy)