public static String addFolderSlashIfNeeded ( String folderName ) { if ( ! "" . equals ( folderName ) && ! folderName . endsWith ( "/" ) ) { return folderName + "/" ; } else { return folderName ; } }
Adds a slash to a path if it doesn t end with a slash .