📄 cgimultipartrequest.java
字号:
/*
*
* Copyright (c) 2004 SourceTap - www.sourcetap.com
*
* The contents of this file are subject to the SourceTap Public License
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
*/
package http.utils.multipartrequest;
import java.io.IOException;
/**
Wrapper for MultipartRequest
*/
public class CgiMultipartRequest extends MultipartRequest {
/**
* Constructor.
*
* @param strSaveDirectory The temporary directory to save the file from where they can then be moved to wherever by the
* calling process. <b>If you specify <u>null</u> for this parameter, then any files uploaded
* will be silently ignored.</B>
*
* @exception IllegalArgumentException If the System.getProperty("CONTENT_TYPE") does not contain a Content-Type of "multipart/form-data" or the boundary is not found.
* @exception IOException If the System.getProperty("CONTENT_LENGTH") is higher than MAX_READ_BYTES or strSaveDirectory is invalid or cannot be written to.
*
* @see MultipartRequest#MAX_READ_BYTES
*/
public CgiMultipartRequest(String strSaveDirectory)
throws IllegalArgumentException, IOException, NumberFormatException {
super(null, System.getProperty("CONTENT_TYPE"),
Integer.parseInt(System.getProperty("CONTENT_LENGTH")), System.in,
strSaveDirectory, null, MultipartRequest.MAX_READ_BYTES);
}
/**
* Constructor.
*
* @param strSaveDirectory The temporary directory to save the file from where they can then be moved to wherever by the
* calling process. <b>If you specify <u>null</u> for this parameter, then any files uploaded
* will be silently ignored.</B>
* @param intMaxReadBytes Overrides the MAX_BYTES_READ value, to allow arbitrarily long files.
*
* @exception IllegalArgumentException If the System.getProperty("CONTENT_TYPE") does not contain a Content-Type of "multipart/form-data" or the boundary is not found.
* @exception IOException If the System.getProperty("CONTENT_LENGTH") is higher than MAX_READ_BYTES or strSaveDirectory is invalid or cannot be written to.
*
* @see MultipartRequest#MAX_READ_BYTES
*/
public CgiMultipartRequest(String strSaveDirectory, int intMaxReadBytes)
throws IllegalArgumentException, IOException, NumberFormatException {
super(null, System.getProperty("CONTENT_TYPE"),
Integer.parseInt(System.getProperty("CONTENT_LENGTH")), System.in,
strSaveDirectory, null, intMaxReadBytes);
}
/**
* Constructor - load into memory constructor
*
* @param debug A PrintWriter that can be used for debugging.
* @param intMaxReadBytes Overrides the MAX_BYTES_READ value, to allow arbitrarily long files.
*
* @exception IllegalArgumentException If the System.getProperty("CONTENT_TYPE") does not contain a Content-Type of "multipart/form-data" or the boundary is not found.
* @exception IOException If the System.getProperty("CONTENT_LENGTH") is higher than MAX_READ_BYTES or strSaveDirectory is invalid or cannot be written to.
*
* @see MultipartRequest#MAX_READ_BYTES
*/
public CgiMultipartRequest(int intMaxReadBytes)
throws IllegalArgumentException, IOException, NumberFormatException {
super(null, System.getProperty("CONTENT_TYPE"),
Integer.parseInt(System.getProperty("CONTENT_LENGTH")), System.in,
intMaxReadBytes);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -