@Test public void testEncodeURIComponent() { String uri = RepositoryPathEncoder.encodeURIComponent( "http: assertEquals( "http%3A%2F%2Fseylermartialarts.com%2Findex.html", uri ); }
public static String encodeURIComponent( String value ) { String encoded = null; try { encoded = URLEncoder.encode( value, "UTF-8" ).replaceAll( "\\+", "%20" ).replaceAll( "\\%21", "!" ).replaceAll( "\\%27", "'" ).replaceAll( "\\%28", "(" ).replaceAll( "\\%29", ")" ).replaceAll( "\\%7E", "~" ); } catch ( UnsupportedEncodingException e ) { encoded = value; } return encoded; }
RepositoryPathEncoder { public static String encodeURIComponent( String value ) { String encoded = null; try { encoded = URLEncoder.encode( value, "UTF-8" ).replaceAll( "\\+", "%20" ).replaceAll( "\\%21", "!" ).replaceAll( "\\%27", "'" ).replaceAll( "\\%28", "(" ).replaceAll( "\\%29", ")" ).replaceAll( "\\%7E", "~" ); } catch ( UnsupportedEncodingException e ) { encoded = value; } return encoded; } }
RepositoryPathEncoder { public static String encodeURIComponent( String value ) { String encoded = null; try { encoded = URLEncoder.encode( value, "UTF-8" ).replaceAll( "\\+", "%20" ).replaceAll( "\\%21", "!" ).replaceAll( "\\%27", "'" ).replaceAll( "\\%28", "(" ).replaceAll( "\\%29", ")" ).replaceAll( "\\%7E", "~" ); } catch ( UnsupportedEncodingException e ) { encoded = value; } return encoded; }  }
RepositoryPathEncoder { public static String encodeURIComponent( String value ) { String encoded = null; try { encoded = URLEncoder.encode( value, "UTF-8" ).replaceAll( "\\+", "%20" ).replaceAll( "\\%21", "!" ).replaceAll( "\\%27", "'" ).replaceAll( "\\%28", "(" ).replaceAll( "\\%29", ")" ).replaceAll( "\\%7E", "~" ); } catch ( UnsupportedEncodingException e ) { encoded = value; } return encoded; }  static String encode( String value ); static String encodeURIComponent( String value ); static String encodeRepositoryPath( String path ); static String decodeRepositoryPath( String path ); }
RepositoryPathEncoder { public static String encodeURIComponent( String value ) { String encoded = null; try { encoded = URLEncoder.encode( value, "UTF-8" ).replaceAll( "\\+", "%20" ).replaceAll( "\\%21", "!" ).replaceAll( "\\%27", "'" ).replaceAll( "\\%28", "(" ).replaceAll( "\\%29", ")" ).replaceAll( "\\%7E", "~" ); } catch ( UnsupportedEncodingException e ) { encoded = value; } return encoded; }  static String encode( String value ); static String encodeURIComponent( String value ); static String encodeRepositoryPath( String path ); static String decodeRepositoryPath( String path );  }