public class GKFileUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DATA_LINE_PATTERN
Regex pattern for parsing data files by line
|
static java.util.regex.Pattern |
FILE_PATTERN
Regex pattern for the return values of files
|
static java.lang.String |
LICENSE_ROOT
Base path for license storage
|
static java.lang.String |
ROOT
Base path of the card
|
| Constructor and Description |
|---|
GKFileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
addExtension(java.lang.String path,
java.lang.String extension)
Read a file and return as a String
|
static java.lang.String |
joinPath(java.lang.String... paths)
Join an array of
String objects using the '/' path separator. |
static GKFile |
parseFile(java.lang.String fileData) |
static java.util.ArrayList<java.lang.String> |
parsePath(java.lang.String path)
Parse path into an ArrayList using the '/' path separator.
|
static java.lang.String |
readFile(java.io.File file)
Read a file and return as a String
|
public static final java.lang.String ROOT
public static final java.lang.String LICENSE_ROOT
public static final java.util.regex.Pattern FILE_PATTERN
public static final java.lang.String DATA_LINE_PATTERN
public static GKFile parseFile(java.lang.String fileData)
fileData - the data returned from a LIST commandGKFile built from the fileDatapublic static java.lang.String joinPath(java.lang.String... paths)
String objects using the '/' path separator.paths - the array of String objects to be joinedpaths delimited by '/'public static java.util.ArrayList<java.lang.String> parsePath(java.lang.String path)
path - the string to be split into the ArrayListpublic static java.lang.String addExtension(java.lang.String path,
java.lang.String extension)
path - the filepath to append the extension toextension - the extension to be appendedpublic static java.lang.String readFile(java.io.File file)
throws java.io.IOException
file - the file to readjava.io.IOException - when reading the file fails