updated HTTP module for 3.1 support

This commit is contained in:
Mark Fisher
2011-12-12 12:10:30 -05:00
parent de5ae9147e
commit efdd27f89a
3 changed files with 35 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,4 +67,18 @@ public class MultipartHttpInputMessage extends ServletServerHttpRequest implemen
return this.multipartServletRequest.getParameterMap();
}
/**
* Once we depend upon Spring 3.1 as a minimum, this code can be changed to:
* this.multipartServletRequest.getMultipartContentType(String paramOrFileName)
*/
public String getMultipartContentType(String paramOrFileName) {
MultipartFile file = getFile(paramOrFileName);
if (file != null) {
return file.getContentType();
}
else {
throw new UnsupportedOperationException("unable to retrieve multipart content-type for parameter");
}
}
}