Java Code Examples for org.springframework.web.util.WebUtils#getTempDir()

The following examples show how to use org.springframework.web.util.WebUtils#getTempDir() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CosMultipartResolver.java    From Lottery with GNU General Public License v2.0 4 votes vote down vote up
public void setServletContext(ServletContext servletContext) {
	if (this.uploadTempDir == null) {
		this.uploadTempDir = WebUtils.getTempDir(servletContext);
	}
}
 
Example 2
Source File: WebApplicationObjectSupport.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Return the temporary directory for the current web application,
 * as provided by the servlet container.
 * @return the File representing the temporary directory
 * @throws IllegalStateException if not running within a ServletContext
 * @see org.springframework.web.util.WebUtils#getTempDir(javax.servlet.ServletContext)
 */
protected final File getTempDir() throws IllegalStateException {
	ServletContext servletContext = getServletContext();
	Assert.state(servletContext != null, "ServletContext is required");
	return WebUtils.getTempDir(servletContext);
}
 
Example 3
Source File: WebApplicationObjectSupport.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Return the temporary directory for the current web application,
 * as provided by the servlet container.
 * @return the File representing the temporary directory
 * @throws IllegalStateException if not running within a ServletContext
 * @see org.springframework.web.util.WebUtils#getTempDir(javax.servlet.ServletContext)
 */
protected final File getTempDir() throws IllegalStateException {
	ServletContext servletContext = getServletContext();
	Assert.state(servletContext != null, "ServletContext is required");
	return WebUtils.getTempDir(servletContext);
}
 
Example 4
Source File: WebApplicationObjectSupport.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Return the temporary directory for the current web application,
 * as provided by the servlet container.
 * @return the File representing the temporary directory
 * @throws IllegalStateException if not running within a ServletContext
 * @see org.springframework.web.util.WebUtils#getTempDir(javax.servlet.ServletContext)
 */
protected final File getTempDir() throws IllegalStateException {
	return WebUtils.getTempDir(getServletContext());
}
 
Example 5
Source File: WebApplicationObjectSupport.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Return the temporary directory for the current web application,
 * as provided by the servlet container.
 * @return the File representing the temporary directory
 * @throws IllegalStateException if not running within a ServletContext
 * @see org.springframework.web.util.WebUtils#getTempDir(javax.servlet.ServletContext)
 */
protected final File getTempDir() throws IllegalStateException {
	return WebUtils.getTempDir(getServletContext());
}
 
Example 6
Source File: CosMultipartResolver.java    From Lottery with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor for standalone usage. Determines the servlet container's
 * temporary directory via the given ServletContext.
 * 
 * @param servletContext
 *            the ServletContext to use (must not be <code>null</code>)
 * @throws IllegalArgumentException
 *             if the supplied {@link ServletContext} is <code>null</code>
 */
public CosMultipartResolver(ServletContext servletContext) {
	this.uploadTempDir = WebUtils.getTempDir(servletContext);
}