public abstract class FilenameVerifier extends Object
Modifier and Type | Method and Description |
---|---|
static File |
getValidatedExistingFile(File dir,
String name)
Create a file handle where the underlying file must exist.
|
static File |
getValidatedFile(File dir,
String... names)
Construct a file handle, applying platform-specific filename validation
rules in the process.
|
static File |
getValidatedNewFile(File dir,
String name)
Create a file handle where the underlying file must not exist.
|
public static File getValidatedFile(File dir, String... names) throws IOException
dir
- The directory acting as a root, which is assumed to be
correctly named. May be null.names
- The names of filename fragments to apply the checks to. Must
have at least one value.IOException
- If validation fails.public static File getValidatedExistingFile(File dir, String name) throws IOException
dir
- The directory that will contain the file.name
- The name of the file; will be validated.IOException
- If validation fails or the file doesn't exist.public static File getValidatedNewFile(File dir, String name) throws IOException
dir
- The directory that will contain the file.name
- The name of the file; will be validated.IOException
- If validation fails or the file does exist.Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.