public class SafeFileChecker extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkSafeFilePath(String path)
do an ESAPI path sanityCheck and prevent a path traversal attack
|
static void |
checkSafeFilePath(String rootPath,
String... subPaths)
do an ESAPI path sanityCheck and prevent a path traversal attack
|
public static void checkSafeFilePath(String path) throws IOException
path
- full path representing a FileSystem resourceIOException
- thrown when any check fails with UnChecked or Runtime exceptionpublic static void checkSafeFilePath(String rootPath, String... subPaths) throws IOException
rootPath
- first or initial part(s) of a path representing a FileSystem resourcesubPaths
- sub (additional) parts after root part(s) to be joined to rootPath parameter
using File.separator FileSystem StringIOException
- thrown when any check fails with UnChecked or Runtime exceptionCopyright © 2018 Vitam. All rights reserved.