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