mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-10-02 18:17:27 +13:00
macOS file fixes
This commit is contained in:
parent
d5e024c43e
commit
ba56fc25ab
1 changed files with 11 additions and 0 deletions
|
@ -17,6 +17,17 @@ public class FileNames {
|
||||||
return path + "/";
|
return path + "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String removeTrailingSlash(String path) {
|
||||||
|
if (path.equals("/")) {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (path.endsWith("/") || path.endsWith("\\")) {
|
||||||
|
return path.substring(0, path.length() - 1);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getFileName(String file) {
|
public static String getFileName(String file) {
|
||||||
if (file.isEmpty()) {
|
if (file.isEmpty()) {
|
||||||
return "";
|
return "";
|
||||||
|
|
Loading…
Reference in a new issue