public final class FileUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
contains(File root,
File file)
Indicates whether the specified file is in the specified containing file.
|
static String |
getMediaType(File f)
Returns the Media Type for the given file.
|
static String |
path(File root,
File file)
Returns the path from the root file to the specified file.
|
public static String getMediaType(File f)
The media type is only based on the file extension.
This method uses the the 'mime.properties' resource file from the classpath which maps file extensions to the corresponding Media Type. This file is loaded once.
f
- The file.null
if not found.public static boolean contains(File root, File file)
root
- the containerfile
- the file to check.true
if the file is within the specified container;
false
otherwise.Copyright © 2016 Allette Systems. All rights reserved.