Commit dafc721b authored by Roumen Petrov's avatar Roumen Petrov

use File.pathSeparator instead hard-coded string

parent 92e646fc
......@@ -24,6 +24,7 @@
import com.termoneplus.BuildConfig;
import java.io.File;
import java.text.Collator;
import java.util.Arrays;
import java.util.Locale;
......@@ -102,7 +103,7 @@ private static String makePathFromBundle(Bundle extras) {
String dir = extras.getString(key);
if (dir != null && !dir.equals("")) {
path.append(dir);
path.append(":");
path.append(File.pathSeparator);
}
}
......
......@@ -84,23 +84,23 @@ private String extendPath(String path) {
s = getAppendPath();
if (!TextUtils.isEmpty(s))
path = path + ":" + s;
path = path + File.pathSeparator + s;
s = getPrependPath();
if (!TextUtils.isEmpty(s))
path = s + ":" + path;
path = s + File.pathSeparator + path;
return path;
}
private String preservePath(String path) {
String[] entries = path.split(":");
String[] entries = path.split(File.pathSeparator);
StringBuilder new_path = new StringBuilder(path.length());
for (String entry : entries) {
File dir = new File(entry);
if (dir.isDirectory() && dir.canExecute()) {
new_path.append(entry);
new_path.append(":");
new_path.append(File.pathSeparator);
}
}
return new_path.substring(0, new_path.length() - 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment