@Test public void testNotEquals3() throws IOException { Hoster hoster1 = Hosters.tryGetHostByURL( new URL( "http: Hoster hoster2 = Hosters.tryGetHostByURL( new URL( "http: boolean equals = hoster1.equals( hoster2 ); Assert.assertFalse( equals ); }
public static Hoster tryGetHostByURL( final URL url ) { final Pattern www = Pattern.compile( "www\\..+" ); String givenUrlHost = url.getHost(); if ( www.matcher( givenUrlHost ).matches() ) { givenUrlHost = givenUrlHost.substring( 4 ); } for ( Hoster h : hosters ) { String hostUrlHost = h.getBaseUrl().getHost(); if ( www.matcher( hostUrlHost ).matches() ) { hostUrlHost = hostUrlHost.substring( 4 ); } if ( hostUrlHost.equalsIgnoreCase( givenUrlHost ) ) { return h; } } return null; }
Hosters { public static Hoster tryGetHostByURL( final URL url ) { final Pattern www = Pattern.compile( "www\\..+" ); String givenUrlHost = url.getHost(); if ( www.matcher( givenUrlHost ).matches() ) { givenUrlHost = givenUrlHost.substring( 4 ); } for ( Hoster h : hosters ) { String hostUrlHost = h.getBaseUrl().getHost(); if ( www.matcher( hostUrlHost ).matches() ) { hostUrlHost = hostUrlHost.substring( 4 ); } if ( hostUrlHost.equalsIgnoreCase( givenUrlHost ) ) { return h; } } return null; } }
Hosters { public static Hoster tryGetHostByURL( final URL url ) { final Pattern www = Pattern.compile( "www\\..+" ); String givenUrlHost = url.getHost(); if ( www.matcher( givenUrlHost ).matches() ) { givenUrlHost = givenUrlHost.substring( 4 ); } for ( Hoster h : hosters ) { String hostUrlHost = h.getBaseUrl().getHost(); if ( www.matcher( hostUrlHost ).matches() ) { hostUrlHost = hostUrlHost.substring( 4 ); } if ( hostUrlHost.equalsIgnoreCase( givenUrlHost ) ) { return h; } } return null; } private  Hosters(); }
Hosters { public static Hoster tryGetHostByURL( final URL url ) { final Pattern www = Pattern.compile( "www\\..+" ); String givenUrlHost = url.getHost(); if ( www.matcher( givenUrlHost ).matches() ) { givenUrlHost = givenUrlHost.substring( 4 ); } for ( Hoster h : hosters ) { String hostUrlHost = h.getBaseUrl().getHost(); if ( www.matcher( hostUrlHost ).matches() ) { hostUrlHost = hostUrlHost.substring( 4 ); } if ( hostUrlHost.equalsIgnoreCase( givenUrlHost ) ) { return h; } } return null; } private  Hosters(); static boolean registerHoster( final Hoster hoster ); static boolean registerHoster( final HosterImpl impl ); static boolean registerHoster( final Class<? extends HosterImpl> clazz ); static Hoster tryGetHostByURL( final URL url ); static Hoster getHostByURL( final URL url ); static Set<Hoster> values(); static SortedSet<Hoster> sortedValues(); static SortedSet<Hoster> sortedValues( final Comparator<Hoster> comparator ); }
Hosters { public static Hoster tryGetHostByURL( final URL url ) { final Pattern www = Pattern.compile( "www\\..+" ); String givenUrlHost = url.getHost(); if ( www.matcher( givenUrlHost ).matches() ) { givenUrlHost = givenUrlHost.substring( 4 ); } for ( Hoster h : hosters ) { String hostUrlHost = h.getBaseUrl().getHost(); if ( www.matcher( hostUrlHost ).matches() ) { hostUrlHost = hostUrlHost.substring( 4 ); } if ( hostUrlHost.equalsIgnoreCase( givenUrlHost ) ) { return h; } } return null; } private  Hosters(); static boolean registerHoster( final Hoster hoster ); static boolean registerHoster( final HosterImpl impl ); static boolean registerHoster( final Class<? extends HosterImpl> clazz ); static Hoster tryGetHostByURL( final URL url ); static Hoster getHostByURL( final URL url ); static Set<Hoster> values(); static SortedSet<Hoster> sortedValues(); static SortedSet<Hoster> sortedValues( final Comparator<Hoster> comparator );  }