fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/websocket/ABaseClientWebSocket.java
private String getWebSocketBaseURIFrom(String webServiceURLParam)
	{
		if(webServiceURLParam == null)
		{
			return null;
		}

		if(webServiceURLParam.trim().length() == 0)
		{
			return UtilGlobal.EMPTY;
		}

		URI uri = URI.create(webServiceURLParam);
		StringBuilder returnBuffer = new StringBuilder();

		String scheme = uri.getScheme();

		if(scheme == null)
		{
			throw new FluidClientException(
					"Unable to get scheme from '"+webServiceURLParam+"' URL.",
					FluidClientException.ErrorCode.ILLEGAL_STATE_ERROR);
		}

		scheme = scheme.trim().toLowerCase();

		//https://localhost:8443/fluid-ws/
		//Scheme...
		if(Constant.HTTP.equals(scheme)) {

			returnBuffer.append(Constant.WS);
		}
		else if(Constant.HTTPS.equals(scheme)) {

			returnBuffer.append(Constant.WSS);
		}
		else {
			returnBuffer.append(uri.getScheme());
		}

		// ://
		returnBuffer.append(Constant.SCHEME_SEP);
		returnBuffer.append(uri.getHost());

		// 80 / 443
		if(uri.getPort() > 0)
		{
			returnBuffer.append(Constant.COLON);
			returnBuffer.append(uri.getPort());
		}

		// /fluid-ws/
		returnBuffer.append(uri.getPath());

		return returnBuffer.toString();
	}
private String getWebSocketBaseURIFrom(String webServiceURLParam)
	{
		if(webServiceURLParam == null)
		{
			return null;
		}

		if(webServiceURLParam.trim().length() == 0)
		{
			return UtilGlobal.EMPTY;
		}

		URI uri = URI.create(webServiceURLParam);
		StringBuilder returnBuffer = new StringBuilder();

		String scheme = uri.getScheme();

		if(scheme == null)
		{
			throw new FluidClientException(
					"Unable to get scheme from '"+webServiceURLParam+"' URL.",
					FluidClientException.ErrorCode.ILLEGAL_STATE_ERROR);
		}

		scheme = scheme.trim().toLowerCase();

		//https://localhost:8443/fluid-ws/
		//Scheme...
		if(Constant.HTTP.equals(scheme)) {

			returnBuffer.append(Constant.WS);
		}
		else if(Constant.HTTPS.equals(scheme)) {

			returnBuffer.append(Constant.WSS);
		}
		else {
			returnBuffer.append(uri.getScheme());
		}

		// ://
		returnBuffer.append(Constant.SCHEME_SEP);
		returnBuffer.append(uri.getHost());

		// 80 / 443
		if(uri.getPort() > 0)
		{
			returnBuffer.append(Constant.COLON);
			returnBuffer.append(uri.getPort());
		}

		// /fluid-ws/
		returnBuffer.append(uri.getPath());

		return returnBuffer.toString();
	}
private String getWebSocketBaseURIFrom ( String webServiceURLParam ) { if ( webServiceURLParam == null ) { return null ; } if ( webServiceURLParam . trim ( ) . length ( ) == 0 ) { return UtilGlobal . EMPTY ; } URI uri = URI . create ( webServiceURLParam ) ; StringBuilder returnBuffer = new StringBuilder ( ) ; String scheme = uri . getScheme ( ) ; if ( scheme == null ) { throw new FluidClientException ( "Unable to get scheme from '" + webServiceURLParam + "' URL." , FluidClientException . ErrorCode . ILLEGAL_STATE_ERROR ) ; } scheme = scheme . trim ( ) . toLowerCase ( ) ; //https://localhost:8443/fluid-ws/ //Scheme... if ( Constant . HTTP . equals ( scheme ) ) { returnBuffer . append ( Constant . WS ) ; } else if ( Constant . HTTPS . equals ( scheme ) ) { returnBuffer . append ( Constant . WSS ) ; } else { returnBuffer . append ( uri . getScheme ( ) ) ; } // :// returnBuffer . append ( Constant . SCHEME_SEP ) ; returnBuffer . append ( uri . getHost ( ) ) ; // 80 / 443 if ( uri . getPort ( ) > 0 ) { returnBuffer . append ( Constant . COLON ) ; returnBuffer . append ( uri . getPort ( ) ) ; } // /fluid-ws/ returnBuffer . append ( uri . getPath ( ) ) ; return returnBuffer . toString ( ) ; }
Retrieves the Web Service URL from {@code webServiceURLParam}.

@param webServiceURLParam The Web Service URL to convert.
@return The Web Socket URL version of {@code webServiceURLParam}.
Retrieves the Web Service URL from { @code webServiceURLParam } .