@Test public void testConvertToJavaPattern( ) { String javaPattern = ProxyHelper.convertToJavaPattern( PATTERN ); String expected = "localhost|.*\\.my\\.company|192\\.168\\..*|127\\.0\\.0\\.1"; assertEquals( "javaPattern", expected, javaPattern ); }
static String convertToJavaPattern( String pattern ) { String javaPattern = pattern; if ( StringUtils.isNotBlank( pattern ) ) { javaPattern = javaPattern.replaceAll( "\\.", "\\\\." ); javaPattern = javaPattern.replaceAll( "\\*", ".*" ); } log.debug( "convertToJavaPattern: javaPattern = '{}'", javaPattern ); return javaPattern; }
ProxyHelper { static String convertToJavaPattern( String pattern ) { String javaPattern = pattern; if ( StringUtils.isNotBlank( pattern ) ) { javaPattern = javaPattern.replaceAll( "\\.", "\\\\." ); javaPattern = javaPattern.replaceAll( "\\*", ".*" ); } log.debug( "convertToJavaPattern: javaPattern = '{}'", javaPattern ); return javaPattern; } }
ProxyHelper { static String convertToJavaPattern( String pattern ) { String javaPattern = pattern; if ( StringUtils.isNotBlank( pattern ) ) { javaPattern = javaPattern.replaceAll( "\\.", "\\\\." ); javaPattern = javaPattern.replaceAll( "\\*", ".*" ); } log.debug( "convertToJavaPattern: javaPattern = '{}'", javaPattern ); return javaPattern; } private  ProxyHelper(  ); }
ProxyHelper { static String convertToJavaPattern( String pattern ) { String javaPattern = pattern; if ( StringUtils.isNotBlank( pattern ) ) { javaPattern = javaPattern.replaceAll( "\\.", "\\\\." ); javaPattern = javaPattern.replaceAll( "\\*", ".*" ); } log.debug( "convertToJavaPattern: javaPattern = '{}'", javaPattern ); return javaPattern; } private  ProxyHelper(  ); static Proxy getProxy( String url ); }
ProxyHelper { static String convertToJavaPattern( String pattern ) { String javaPattern = pattern; if ( StringUtils.isNotBlank( pattern ) ) { javaPattern = javaPattern.replaceAll( "\\.", "\\\\." ); javaPattern = javaPattern.replaceAll( "\\*", ".*" ); } log.debug( "convertToJavaPattern: javaPattern = '{}'", javaPattern ); return javaPattern; } private  ProxyHelper(  ); static Proxy getProxy( String url ); static final String DEFAULT_PROTOCOL; }