Android Utililty Methods Path Separator Get

List of utility methods to do Path Separator Get

Description

The list of methods to do Path Separator Get are organized into topic(s).

Method

StringfixFileSeparators(String filename)
Fix up filename separators for platform independence.
if (filename == null) {
    return null;
switch (File.separatorChar) {
case '/':
    return filename.replace('\\', File.separatorChar);
case '\\':
    return filename.replace('/', File.separatorChar);
...
StringgetPathSeparator()
get Path Separator
return java.io.File.pathSeparator;
StringgetSeparator()
get Separator
return System.getProperty("file.separator");
booleanisWindowsPathSeparator(String p_filename)
Check if the filename contains Windows path separator.
if (StringUtil.isEmpty(p_filename))
    return true;
if (p_filename.indexOf("/") != -1)
    return false;
else if (p_filename.indexOf("\\") != -1)
    return true;
return false;
FilefixFileSeparators(File file)
Fix up file separators for platform independence.
if (file == null) {
    return null;
return new File(fixFileSeparators(file.getPath()));