String patchType=t1.getText(); String patchName=t2.getText(); String desc=t3.getText(); String repository=t4.getText(); String userName=t5.getText(); String passwd=t6.getText(); byte [] sysex = p.sysex; if (patchName.length()<4) ErrorMsg.reportError("Error","Patch Name must be at least 4 characters."); else if (desc.length()<20) ErrorMsg.reportError("Error","Description must be at least 20 characters."); else if (userName.length()<1) ErrorMsg.reportError("Error","Please supply a Contributer's User Name"); else if (passwd.length()<1) ErrorMsg.reportError("Error","Please supply the Contributer's Password for the Repository"); else if (repository.length()<5) ErrorMsg.reportError("Error","Please supply the Repository URL Address"); else { String mime = new String(); mime = mimeBoundary(); mime += makeMime("name",patchName); mime += mimeBoundary(); mime += makeMime("synthName",patchType); mime += mimeBoundary(); try{ String filestr=new String (sysex,"ISO-8859-1"); mime += makeMime("file",filestr); } catch (Exception e) {System.out.println("UploadPatchDialog encoding failed.");} mime += mimeBoundary(); mime += makeMime("username",userName); mime += mimeBoundary(); mime += makeMime("pass",passwd); mime += mimeBoundary(); mime += makeMime("comment",desc); mime += mimeBoundary(); mime += makeMime("synth","1"); mime += mimeBoundary(); mime += makeMime("send","Upload"); mime += mimeBoundary(); mime += "\r\n\r\n"; System.out.println(mime); postData(repository,mime); }
void uploadPatch(Patch p){}