private String removeFinalSlash ( String path ) { if ( path != null && ! path . isEmpty ( ) && path . endsWith ( "/" ) ) { return path . substring ( 0 , path . length ( ) - 1 ) ; } return path ; }
Due a bug in Pact we need to remove final slash character on path