public static String removeTrailingSlash ( String path ) { if ( path . endsWith ( "/" ) ) return path . substring ( 0 , path . length ( ) - 1 ) ; else return path ; }
Removes a trailing slash if exists