opendap/src/main/java/opendap/dap/DConnect2.java
private String getCompleteCE(String CE)
    {
        String localProjString = null;
        String localSelString = null;
        if(CE == null)
            return "";
        //remove any leading '?'
        if(CE.startsWith("?")) CE = CE.substring(1);
        int selIndex = CE.indexOf('&');
        if(selIndex == 0) {
            localProjString = "";
            localSelString = CE;
        } else if(selIndex > 0) {
            localSelString = CE.substring(selIndex);
            localProjString = CE.substring(0, selIndex);
        } else {// selIndex < 0
            localProjString = CE;
            localSelString = "";
        }

        String ce = projString;

        if(!localProjString.equals("")) {
            if(!ce.equals("") && localProjString.indexOf(',') != 0)
                ce += ",";
            ce += localProjString;
        }

        if(!selString.equals("")) {
            if(selString.indexOf('&') != 0)
                ce += "&";
            ce += selString;
        }

        if(!localSelString.equals("")) {
            if(localSelString.indexOf('&') != 0)
                ce += "&";
            ce += localSelString;
        }

        if(ce.length() > 0) ce = "?" + ce;

        if(false) {
            DAPNode.log.debug("projString: '" + projString + "'");
            DAPNode.log.debug("localProjString: '" + localProjString + "'");
            DAPNode.log.debug("selString: '" + selString + "'");
            DAPNode.log.debug("localSelString: '" + localSelString + "'");
            DAPNode.log.debug("Complete CE: " + ce);
        }
        return ce;   // escaping will happen elsewhere
    }
private String getCompleteCE(String CE)
    {
        String localProjString = null;
        String localSelString = null;
        if(CE == null)
            return "";
        //remove any leading '?'
        if(CE.startsWith("?")) CE = CE.substring(1);
        int selIndex = CE.indexOf('&');
        if(selIndex == 0) {
            localProjString = "";
            localSelString = CE;
        } else if(selIndex > 0) {
            localSelString = CE.substring(selIndex);
            localProjString = CE.substring(0, selIndex);
        } else {// selIndex < 0
            localProjString = CE;
            localSelString = "";
        }

        String ce = projString;

        if(!localProjString.equals("")) {
            if(!ce.equals("") && localProjString.indexOf(',') != 0)
                ce += ",";
            ce += localProjString;
        }

        if(!selString.equals("")) {
            if(selString.indexOf('&') != 0)
                ce += "&";
            ce += selString;
        }

        if(!localSelString.equals("")) {
            if(localSelString.indexOf('&') != 0)
                ce += "&";
            ce += localSelString;
        }

        if(ce.length() > 0) ce = "?" + ce;

        if(false) {
            DAPNode.log.debug("projString: '" + projString + "'");
            DAPNode.log.debug("localProjString: '" + localProjString + "'");
            DAPNode.log.debug("selString: '" + selString + "'");
            DAPNode.log.debug("localSelString: '" + localSelString + "'");
            DAPNode.log.debug("Complete CE: " + ce);
        }
        return ce;   // escaping will happen elsewhere
    }
private String getCompleteCE ( String CE ) { String localProjString = null ; String localSelString = null ; if ( CE == null ) return "" ; //remove any leading '?' if ( CE . startsWith ( "?" ) ) CE = CE . substring ( 1 ) ; int selIndex = CE . indexOf ( ' ' ) ; if ( selIndex == 0 ) { localProjString = "" ; localSelString = CE ; } else if ( selIndex > 0 ) { localSelString = CE . substring ( selIndex ) ; localProjString = CE . substring ( 0 , selIndex ) ; } else { // selIndex < 0 localProjString = CE ; localSelString = "" ; } String ce = projString ; if ( ! localProjString . equals ( "" ) ) { if ( ! ce . equals ( "" ) && localProjString . indexOf ( ' ' ) != 0 ) ce += "," ; ce += localProjString ; } if ( ! selString . equals ( "" ) ) { if ( selString . indexOf ( ' ' ) != 0 ) ce += "&" ; ce += selString ; } if ( ! localSelString . equals ( "" ) ) { if ( localSelString . indexOf ( ' ' ) != 0 ) ce += "&" ; ce += localSelString ; } if ( ce . length ( ) > 0 ) ce = "?" + ce ; if ( false ) { DAPNode . log . debug ( "projString: '" + projString + "'" ) ; DAPNode . log . debug ( "localProjString: '" + localProjString + "'" ) ; DAPNode . log . debug ( "selString: '" + selString + "'" ) ; DAPNode . log . debug ( "localSelString: '" + localSelString + "'" ) ; DAPNode . log . debug ( "Complete CE: " + ce ) ; } return ce ; // escaping will happen elsewhere }
Use some sense when assembling the CE. Since this DConnect
object may have constructed using a CE, any new CE will
have to be integrated into it for subsequent requests.
Try to do this in a sensible manner!

@param CE The new CE from the client.
@return The complete CE (the one this object was built
with integrated with the clients)
Use some sense when assembling the CE . Since this DConnect object may have constructed using a CE any new CE will have to be integrated into it for subsequent requests . Try to do this in a sensible manner!