public static AttachData parseAttachData(String attachString) {
        AttachData retVal = null;
        if(attachString != null){
            retVal = new AttachData();
            if(!attachString.contains("=")){
                retVal.setURI(attachString);
            } else {
                String value = null;
                boolean isBinaryValue = false;
                for(String s: attachString.split(";")){
                    //The logic of separating valu/uri like this depends upon existing standard default values.
                    if(s.contains(":")){
                        value = s.substring(s.indexOf(":")+1);
                        s = s.substring(0,s.indexOf(":"));
                    }

                    if(s.startsWith("FMTTYPE=")){
                        retVal.setFMTTYPE(s.substring(s.indexOf("=")+1));
                    } else if(s.startsWith("ENCODING=")){
                        retVal.setENCODING(s.substring(s.indexOf("=")+1));
                    } else if(s.startsWith("VALUE=")){
                        retVal.setVALUE(s.substring(s.indexOf("=")+1));
                        isBinaryValue = true;
                    }

                    if(isBinaryValue){
                        retVal.setBINARY(value);
                    } else {
                        retVal.setURI(value);
                    }
                }
            }
        }
        return retVal;
    }