RepositoryPathEncoder { public static String encode( String value ) { String encoded = encodeURIComponent( value ); return encoded.replace( "%5C", "%255C" ).replace( "%2F", "%252F" ); }  static String encode( String value ); static String encodeURIComponent( String value ); static String encodeRepositoryPath( String path ); static String decodeRepositoryPath( String path );  }
@Test public void testEncode() { Assert.assertEquals( "%3Apublic%3ASteel%20Wheels%3AFile%09WithColon", RepositoryPathEncoder .encode( ":public:Steel Wheels:File\tWithColon" ) ); Assert.assertEquals( "%3Apublic%3ASteel%20Wheels%3AFile%09With%255CColon", RepositoryPathEncoder .encode( ":public:Steel Wheels:File\tWith%5CColon" ) ); }
@Test public void testEncode() { String encoded = RepositoryPathEncoder.encode( "http: assertEquals( "http%3A%252F%252Fseylermartialarts.com%252Findex.html", encoded ); }