ADD A TRAILING SLASH IN PATH IF NOT EXISTS
1 2 3 4 |
String path = "/path/to/folder"; if(path.charAt(path.length()-1)!=File.separatorChar){ path += File.separator; } |
My Development Experience
ADD A TRAILING SLASH IN PATH IF NOT EXISTS
1 2 3 4 |
String path = "/path/to/folder"; if(path.charAt(path.length()-1)!=File.separatorChar){ path += File.separator; } |