public class FileUtil
extends java.lang.Object
| Constructor and Description |
|---|
FileUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
asPath(java.io.File file)
platform independent file.getPath()
|
static java.lang.String |
asPath(java.lang.String path)
platform independent file.getPath()
|
static boolean |
directoryOnlyIfNotIgnored(java.io.File file)
Ignores directory (and children) if it contains a file named ".jbakeignore".
|
static java.lang.String |
fileExt(java.io.File src) |
static java.lang.String |
fileExt(java.lang.String name) |
static java.lang.String |
findExtension(org.apache.commons.configuration.CompositeConfiguration config,
java.lang.String docType) |
static java.io.FileFilter |
getFileFilter()
Filters files based on their file extension.
|
static java.io.FileFilter |
getNotContentFileFilter()
Gets the list of files that are not content files based on their extension.
|
static java.io.File |
getRunningLocation()
Works out the folder where JBake is running from.
|
static boolean |
isExistingFolder(java.io.File f) |
static java.lang.String |
sha1(java.io.File sourceFile)
Computes the hash of a file or directory.
|
public static java.io.FileFilter getFileFilter()
public static java.io.FileFilter getNotContentFileFilter()
public static boolean directoryOnlyIfNotIgnored(java.io.File file)
file - FileBoolean true/falsepublic static boolean isExistingFolder(java.io.File f)
public static java.io.File getRunningLocation()
throws java.lang.Exception
java.lang.Exception - when application is not able to work out where is JBake running frompublic static java.lang.String fileExt(java.io.File src)
public static java.lang.String fileExt(java.lang.String name)
public static java.lang.String sha1(java.io.File sourceFile)
throws java.lang.Exception
sourceFile - the original file or directoryjava.lang.Exception - if any IOException of SecurityException occuredpublic static java.lang.String findExtension(org.apache.commons.configuration.CompositeConfiguration config,
java.lang.String docType)
public static java.lang.String asPath(java.io.File file)
file - the file to transform, or nullnull
Needed to transform Windows path separators into slashes.public static java.lang.String asPath(java.lang.String path)
path - the path to transform, or null