public class FileUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FileUtil.DirectoryFileFilter
file filter to get directories
|
static class |
FileUtil.PrefixFileFilter
get files that start with specified prefix.
|
static class |
FileUtil.SuffixFileFilter
filter files by suffix
|
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
addFilenameToDir(String outdir,
String filename) |
static boolean |
checkFileRead(String file) |
static void |
createOutdir(String outdir) |
static String |
getDataFilePrefix(String outdir,
String label,
Integer run,
Integer fold,
Boolean train)
construct file name for train/test set, will be like
label[label]_run[run]_fold[fold]_train
|
static Double |
getDoubleProperty(Properties props,
String propKey,
Double defaultProp) |
static String |
getFoldFilePrefix(String outdir,
String label,
Integer run,
Integer fold)
construct file name with label, run, fold with format
label[label]_run[run]_fold[fold]_ only put in the non-null
pieces.
|
static Integer |
getIntegerProperty(Properties props,
String propKey,
Integer defaultProp) |
static String |
getScopedFileName(String outdir,
String label,
Integer run,
Integer fold,
String suffix)
generate file name for given outdir and 'scope'
|
static Properties |
loadProperties(String fileName,
boolean systemOverride) |
static int |
parseFoldFromFileName(String filename)
extract fold from file name produced by file util
|
static String |
parseLabelFromFileName(String filename)
extract label from file name produced by file util
|
static Integer |
parseRunFromFileName(String filename)
extract run from file name produced by file util
|
public static int parseFoldFromFileName(String filename)
filename
- public static Integer parseRunFromFileName(String filename)
filename
- public static String parseLabelFromFileName(String filename)
filename
- public static String getFoldFilePrefix(String outdir, String label, Integer run, Integer fold)
outdir
- label
- run
- fold
- public static String getScopedFileName(String outdir, String label, Integer run, Integer fold, String suffix)
outdir
- label
- run
- fold
- suffix
- added to filegetFoldFilePrefix(java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer)
,
getFoldFilePrefix(java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer)
,
getFoldFilePrefix(java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer)
,
getFoldFilePrefix(java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer)
public static String getDataFilePrefix(String outdir, String label, Integer run, Integer fold, Boolean train)
outdir
- label
- run
- fold
- train
- public static void createOutdir(String outdir) throws IOException
IOException
public static boolean checkFileRead(String file)
public static Properties loadProperties(String fileName, boolean systemOverride) throws IOException
IOException
public static Double getDoubleProperty(Properties props, String propKey, Double defaultProp)
public static Integer getIntegerProperty(Properties props, String propKey, Integer defaultProp)
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.