public abstract class UploadDownloadUtils extends Object
| Constructor and Description |
|---|
UploadDownloadUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.alibaba.fastjson2.JSONObject |
checkFileRange(FileStore fileStore,
FileBaseInfo fileInfo,
long size) |
static FileInfo |
createFileBaseInfo(javax.servlet.http.HttpServletRequest request) |
static FileInfo |
createFileBaseInfo(javax.servlet.http.HttpServletRequest request,
String fileMd5,
long fileSize) |
static FileInfo |
createFileBaseInfo(String fileIdIncludeMd5AndSize) |
static void |
downFileRange(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
InputStream inputStream,
long fSize,
String fileName,
String downloadType,
String charset) |
static void |
downloadFile(InputStream downloadFile,
String fileName,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static void |
downloadFile(InputStream downloadFile,
String fileName,
javax.servlet.http.HttpServletResponse response) |
static String |
encodeDownloadFilename(String paramName) |
static String |
encodeDownloadFilename(String paramName,
String downloadType) |
static String |
encodeFileName(String fileName,
String characterEncoding) |
static org.apache.commons.lang3.tuple.Pair<String,InputStream> |
fetchInputStreamFromMultipartResolver(javax.servlet.http.HttpServletRequest request) |
static org.apache.commons.lang3.tuple.Pair<String,InputStream> |
fetchInputStreamFromRequest(javax.servlet.http.HttpServletRequest request)
Deprecated.
|
static org.apache.commons.lang3.tuple.Pair<String,InputStream> |
fetchInputStreamFromRequest(javax.servlet.http.HttpServletRequest request,
boolean useCommonsReolver) |
static org.apache.commons.lang3.tuple.Pair<String,InputStream> |
fetchInputStreamFromStandardResolver(javax.servlet.http.HttpServletRequest request) |
static com.alibaba.fastjson2.JSONObject |
makeRangeCheckJson(long rangeFileSize,
String fileMd5,
boolean hasStored) |
static com.alibaba.fastjson2.JSONObject |
makeRangeUploadCompleteJson(long fileSize,
Object fileInfo,
String message) |
static com.alibaba.fastjson2.JSONObject |
makeRangeUploadCompleteJson(String fileMd5,
long fileSize,
String fileName,
String fileId,
String message) |
static com.alibaba.fastjson2.JSONObject |
makeRangeUploadJson(long rangeFileSize,
String fileMd5,
String fileName) |
static long |
uploadRange(String tempFilePath,
InputStream fileInputStream,
String token,
long size,
javax.servlet.http.HttpServletRequest request) |
public static com.alibaba.fastjson2.JSONObject checkFileRange(FileStore fileStore, FileBaseInfo fileInfo, long size)
public static org.apache.commons.lang3.tuple.Pair<String,InputStream> fetchInputStreamFromRequest(javax.servlet.http.HttpServletRequest request, boolean useCommonsReolver) throws IOException
IOExceptionpublic static org.apache.commons.lang3.tuple.Pair<String,InputStream> fetchInputStreamFromMultipartResolver(javax.servlet.http.HttpServletRequest request) throws IOException
IOExceptionpublic static org.apache.commons.lang3.tuple.Pair<String,InputStream> fetchInputStreamFromStandardResolver(javax.servlet.http.HttpServletRequest request) throws IOException
IOException@Deprecated public static org.apache.commons.lang3.tuple.Pair<String,InputStream> fetchInputStreamFromRequest(javax.servlet.http.HttpServletRequest request) throws IOException, org.apache.commons.fileupload.FileUploadException
IOExceptionorg.apache.commons.fileupload.FileUploadExceptionpublic static String encodeDownloadFilename(String paramName, String downloadType)
public static void downFileRange(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
InputStream inputStream,
long fSize,
String fileName,
String downloadType,
String charset)
throws IOException
request - HttpServletRequestresponse - HttpServletResponseinputStream - InputStreamfSize - longfileName - fileNamedownloadType - 下载方式charset - 编码IOException - IOExceptionpublic static long uploadRange(String tempFilePath, InputStream fileInputStream, String token, long size, javax.servlet.http.HttpServletRequest request) throws IOException, com.centit.support.common.ObjectException
tempFilePath - 需要保存的临时文件路径token - Stringsize - longfileInputStream - InputStreamrequest - HttpServletRequestIOException - IOExceptioncom.centit.support.common.ObjectException - ObjectExceptionpublic static com.alibaba.fastjson2.JSONObject makeRangeCheckJson(long rangeFileSize,
String fileMd5,
boolean hasStored)
public static com.alibaba.fastjson2.JSONObject makeRangeUploadJson(long rangeFileSize,
String fileMd5,
String fileName)
public static com.alibaba.fastjson2.JSONObject makeRangeUploadCompleteJson(long fileSize,
Object fileInfo,
String message)
public static com.alibaba.fastjson2.JSONObject makeRangeUploadCompleteJson(String fileMd5, long fileSize, String fileName, String fileId, String message)
public static void downloadFile(InputStream downloadFile, String fileName, javax.servlet.http.HttpServletResponse response) throws IOException
IOExceptionpublic static void downloadFile(InputStream downloadFile, String fileName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
IOExceptionpublic static FileInfo createFileBaseInfo(javax.servlet.http.HttpServletRequest request)
public static FileInfo createFileBaseInfo(javax.servlet.http.HttpServletRequest request, String fileMd5, long fileSize)
Copyright © 2024 Centit Information Technical, co. Inc.. All rights reserved.