Class FileUtils
- java.lang.Object
-
- org.pentaho.platform.web.http.api.resources.utils.FileUtils
-
public class FileUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENCODED_PATH_SEPARATOR
static String
PATH_SEPARATOR
-
Constructor Summary
Constructors Constructor Description FileUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
closeQuietly(FileInputStream fileInputStream)
Gracefully closes a fileInputStreamstatic boolean
containsControlCharacters(String path)
Checks whetherpath
contains any of Control Charactersstatic boolean
containsReservedCharacter(String path, char[] reserved)
Checks whetherpath
contains any ofreserved
.static String[]
convertCommaSeparatedStringToArray(String stringToConvert)
static String
getParentPath(String path)
static String
idToPath(String pathId)
static boolean
isRootLevelPath(String path)
-
-
-
Field Detail
-
PATH_SEPARATOR
public static final String PATH_SEPARATOR
- See Also:
- Constant Field Values
-
ENCODED_PATH_SEPARATOR
public static final String ENCODED_PATH_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
closeQuietly
public static boolean closeQuietly(FileInputStream fileInputStream)
Gracefully closes a fileInputStream- Parameters:
fileInputStream
- TheFileInputStream
- Returns:
- returns true if the file input stream is successfully closed, false otherwise
-
containsReservedCharacter
public static boolean containsReservedCharacter(String path, char[] reserved)
Checks whetherpath
contains any ofreserved
.- Parameters:
path
- unix-style pathreserved
- array of reserved characters- Returns:
true
if any ofreserved
is contained bypath
-
containsControlCharacters
public static boolean containsControlCharacters(String path)
Checks whetherpath
contains any of Control Characters- Parameters:
path
- to be validated- Returns:
true
if any ofControl Characters
is contained inpath
-
convertCommaSeparatedStringToArray
public static String[] convertCommaSeparatedStringToArray(String stringToConvert)
-
isRootLevelPath
public static boolean isRootLevelPath(String path)
-
-