/** * Same as {@link #setBaseUrl(URL)} except that a * {@link MalformedURLException} may occur when creating the {@link URL} * instance from the given parameters. * * @param aScheme The {@link Scheme} (e.g. {@link Scheme#HTTP} or * {@link Scheme#HTTPS}) to be used for the base {@link URL}. * * @param aHost The host to which the base {@link URL} is to point to. * * @param aPath The path on the host to which the base {@link URL} is to * point to. * * @throws MalformedURLException in case the parameters cannot be * converted to a valid (accepted) {@link URL}. */ default void setBaseUrl( Scheme aScheme, String aHost, String aPath ) throws MalformedURLException { int thePort = -1; if ( Scheme.HTTP == aScheme ) thePort = Port.HTTP.getPort(); if ( Scheme.HTTPS == aScheme ) thePort = Port.HTTPS.getPort(); setBaseUrl( new URL( aScheme.getName(), aHost, thePort, "" ) ); }
/** * Same as {@link #setBaseUrl(URL)} except that a * {@link MalformedURLException} may occur when creating the {@link URL} * instance from the given parameters. * * @param aScheme The {@link Scheme} (e.g. {@link Scheme#HTTP} or * {@link Scheme#HTTPS}) to be used for the base {@link URL}. * * @param aHost The host to which the base {@link URL} is to point to. * * @throws MalformedURLException in case the parameters cannot be * converted to a valid (accepted) {@link URL}. */ default void setBaseUrl( Scheme aScheme, String aHost ) throws MalformedURLException { int thePort = -1; if ( Scheme.HTTP == aScheme ) thePort = Port.HTTP.getPort(); if ( Scheme.HTTPS == aScheme ) thePort = Port.HTTPS.getPort(); setBaseUrl( new URL( aScheme.getName(), aHost, thePort, "" ) ); }
/** * Same as {@link #withBaseUrl(URL)} except that a * {@link MalformedURLException} may occur when creating the {@link URL} * instance from the given parameters. * * @param aScheme The {@link Scheme} (e.g. {@link Scheme#HTTP} or * {@link Scheme#HTTPS}) to be used for the base {@link URL}. * * @param aHost The host to which the base {@link URL} is to point to. * * @return The builder for applying multiple build operations. * * @throws MalformedURLException in case the parameters cannot be * converted to a valid (accepted) {@link URL}. */ default B withBaseUrl( Scheme aScheme, String aHost ) throws MalformedURLException { int thePort = -1; if ( Scheme.HTTP == aScheme ) thePort = Port.HTTP.getPort(); if ( Scheme.HTTPS == aScheme ) thePort = Port.HTTPS.getPort(); return withBaseUrl( new URL( aScheme.getName(), aHost, thePort, "" ) ); }
/** * Same as {@link #withBaseUrl(URL)} except that a * {@link MalformedURLException} may occur when creating the {@link URL} * instance from the given parameters. * * @param aScheme The {@link Scheme} (e.g. {@link Scheme#HTTP} or * {@link Scheme#HTTPS}) to be used for the base {@link URL}. * * @param aHost The host to which the base {@link URL} is to point to. * * @param aPath The path on the host to which the base {@link URL} is to * point to. * * @return The builder for applying multiple build operations. * * @throws MalformedURLException in case the parameters cannot be * converted to a valid (accepted) {@link URL}. */ default B withBaseUrl( Scheme aScheme, String aHost, String aPath ) throws MalformedURLException { int thePort = -1; if ( Scheme.HTTP == aScheme ) thePort = Port.HTTP.getPort(); if ( Scheme.HTTPS == aScheme ) thePort = Port.HTTPS.getPort(); return withBaseUrl( new URL( aScheme.getName(), aHost, thePort, aPath ) ); }
/** * Same as {@link #setBaseUrl(URL)} except that a * {@link MalformedURLException} may occur when creating the {@link URL} * instance from the given parameters. * * @param aProtocol The protocol (e.g. HTTP or HTTPS) to be used for the * base {@link URL}. * * @param aHost The host to which the base {@link URL} is to point to. * * @throws MalformedURLException in case the parameters cannot be * converted to a valid (accepted) {@link URL}. */ default void setBaseUrl( String aProtocol, String aHost ) throws MalformedURLException { int thePort = -1; if ( Scheme.HTTP.getName().equalsIgnoreCase( aProtocol ) ) thePort = Port.HTTP.getPort(); if ( Scheme.HTTPS.getName().equalsIgnoreCase( aProtocol ) ) thePort = Port.HTTPS.getPort(); setBaseUrl( new URL( aProtocol, aHost, thePort, "" ) ); }
/** * Same as {@link #withBaseUrl(URL)} except that a * {@link MalformedURLException} may occur when creating the {@link URL} * instance from the given parameters. * * @param aProtocol The protocol (e.g. HTTP or HTTPS) to be used for the * base {@link URL}. * * @param aHost The host to which the base {@link URL} is to point to. * * @return The builder for applying multiple build operations. * * @throws MalformedURLException in case the parameters cannot be * converted to a valid (accepted) {@link URL}. */ default B withBaseUrl( String aProtocol, String aHost ) throws MalformedURLException { int thePort = -1; if ( Scheme.HTTP.getName().equalsIgnoreCase( aProtocol ) ) thePort = Port.HTTP.getPort(); if ( Scheme.HTTPS.getName().equalsIgnoreCase( aProtocol ) ) thePort = Port.HTTPS.getPort(); return withBaseUrl( new URL( aProtocol, aHost, thePort, "" ) ); }
/** * Same as {@link #setBaseUrl(URL)} except that a * {@link MalformedURLException} may occur when creating the {@link URL} * instance from the given parameters. * * @param aProtocol The protocol (e.g. HTTP or HTTPS) to be used for the * base {@link URL}. * * @param aHost The host to which the base {@link URL} is to point to. * * @param aPath The path on the host to which the base {@link URL} is to * point to. * * @throws MalformedURLException in case the parameters cannot be * converted to a valid (accepted) {@link URL}. */ default void setBaseUrl( String aProtocol, String aHost, String aPath ) throws MalformedURLException { int thePort = -1; if ( Scheme.HTTP.getName().equalsIgnoreCase( aProtocol ) ) thePort = Port.HTTP.getPort(); if ( Scheme.HTTPS.getName().equalsIgnoreCase( aProtocol ) ) thePort = Port.HTTPS.getPort(); setBaseUrl( new URL( aProtocol, aHost, thePort, "" ) ); }
/** * Same as {@link #withBaseUrl(URL)} except that a * {@link MalformedURLException} may occur when creating the {@link URL} * instance from the given parameters. * * @param aProtocol The protocol (e.g. HTTP or HTTPS) to be used for the * base {@link URL}. * * @param aHost The host to which the base {@link URL} is to point to. * * @param aPath The path on the host to which the base {@link URL} is to * point to. * * @return The builder for applying multiple build operations. * * @throws MalformedURLException in case the parameters cannot be * converted to a valid (accepted) {@link URL}. */ default B withBaseUrl( String aProtocol, String aHost, String aPath ) throws MalformedURLException { int thePort = -1; if ( Scheme.HTTP.getName().equalsIgnoreCase( aProtocol ) ) thePort = Port.HTTP.getPort(); if ( Scheme.HTTPS.getName().equalsIgnoreCase( aProtocol ) ) thePort = Port.HTTPS.getPort(); return withBaseUrl( new URL( aProtocol, aHost, thePort, aPath ) ); }