removed 404 handling

This commit is contained in:
Tony Tam 2015-03-26 23:09:29 -07:00
parent 8b98a92805
commit ddb1d6e0d3

View File

@ -11,6 +11,7 @@ import java.util.*;
{{/imports}}
import com.sun.jersey.multipart.FormDataMultiPart;
import com.sun.jersey.multipart.file.FileDataBodyPart;
import javax.ws.rs.core.MediaType;
@ -77,7 +78,8 @@ public class {{classname}} {
mp.field("{{baseName}}", ApiInvoker.parameterToString({{paramName}}), MediaType.MULTIPART_FORM_DATA_TYPE);
{{/notFile}}{{#isFile}}
hasFields = true;
mp.field("{{baseName}}", {{paramName}}, MediaType.MULTIPART_FORM_DATA_TYPE);
mp.field("{{baseName}}", file.getName());
mp.bodyPart(new FileDataBodyPart("{{baseName}}", {{paramName}}, MediaType.MULTIPART_FORM_DATA_TYPE));
{{/isFile}}{{/formParams}}
if(hasFields)
postBody = mp;
@ -96,12 +98,7 @@ public class {{classname}} {
return {{#returnType}}null{{/returnType}};
}
} catch (ApiException ex) {
if(ex.getCode() == 404) {
return {{#returnType}} null{{/returnType}};
}
else {
throw ex;
}
throw ex;
}
}
{{/operation}}