public final class FileUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertFileIsInConfigDir(Configuration configuration,
java.io.File file)
Verify that the file is within the configuration directory.
|
static boolean |
assertIsSubDirectory(java.lang.String descriptorOfBase,
java.io.File child,
java.io.File... baseFiles)
Verify that the file is within the base directory.
|
static java.net.URL |
testForLegalFileUrl(Configuration configuration,
java.net.URL url)
Check if the url is a file url which is either relative to the configuration directory or refers to a file in the
configuration directory.
|
public static java.net.URL testForLegalFileUrl(Configuration configuration, java.net.URL url)
url - the url to testconfiguration - the configuration to test relativity.public static void assertFileIsInConfigDir(Configuration configuration, java.io.File file)
configuration - the configuration to test relativity.file - the file to testpublic static boolean assertIsSubDirectory(java.lang.String descriptorOfBase,
java.io.File child,
java.io.File... baseFiles)
IllegalFileAccessException will be thrown
if the assertion does not hold.descriptorOfBase - a simple description of the base file, for example: configurationchild - the file to test that is is a child of base.baseFiles - the directories that can legally contain the child.