Add a trailing slash in path if not exists – Java
String path = "/path/to/folder";
if(path.charAt(path.length()-1)!=File.separatorChar){
    path += File.separator;
}
%d bloggers like this: