+ * | setMultipartFileName | Name of file | Name of form parameter for the uploaded file | ContentType of file | CharSet of file |
+ *
+ * body text should be location of file which needs to be sent
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void addMultipartFileName() {
+ CellWrapper cellFileName = row.getCell(1);
+ CellWrapper cellParamName = row.getCell(2);
+ CellWrapper cellContentType = row.getCell(3);
+ CellWrapper cellCharset = row.getCell(4);
+ if (cellFileName == null) {
+ getFormatter().exception(row.getCell(0),
+ "You must pass a multipart file name to set");
+ } else {
+ // Param Name
+ String multipartParamName = FILE;
+ if (cellParamName !=null ) {
+ multipartParamName = GLOBALS.substitute(cellParamName.text());
+ }
+ // FileName
+ String multipartFileName = GLOBALS.substitute(cellFileName.text());
+ // ContentType
+ String multipartContentType = null;
+ if (cellContentType !=null ) {
+ multipartContentType = GLOBALS.substitute(cellContentType.text());
+ }
+ // Charset
+ String multipartCharSet = null;
+ if (cellCharset !=null ) {
+ multipartCharSet = GLOBALS.substitute(cellCharset.text());
+ }
+ // Register Multipart
+ RestMultipart restMultipart = new RestMultipart(multipartFileName, multipartContentType, multipartCharSet);
+ multiFileNameByParamName.put(multipartParamName, restMultipart);
+ // Display Replacement
+ renderReplacement(cellFileName, multipartFileName);
+ if (cellParamName!=null) {
+ renderReplacement(cellParamName, multipartParamName);
+ }
+ if (cellContentType!=null) {
+ renderReplacement(cellContentType, multipartContentType);
+ }
+ if (cellCharset!=null) {
+ renderReplacement(cellCharset, multipartCharSet);
+ }
+ }
+ }
+
/**
* @return the multipart filename
*/
@@ -1023,11 +1077,24 @@ protected void doMethod(String method, String resUrl, Map