Package org.miaixz.bus.core.io.resource
Class HttpResource
java.lang.Object
org.miaixz.bus.core.io.resource.HttpResource
- All Implemented Interfaces:
Serializable,Resource
HTTP资源,用于自定义表单数据,可自定义Content-Type
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription获取自定义Content-Type类型getName()获取资源名,例如文件资源的资源名为文件名获得InputStreamgetUrl()获得解析后的URL,无对应URL的返回nulllongsize()获取资源大小Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.core.io.resource.Resource
getReader, isModified, readBytes, readString, readString, writeTo
-
Constructor Details
-
HttpResource
构造- Parameters:
resource- 资源,非空contentType- Content-Type类型,null表示不设置
-
-
Method Details
-
getName
Description copied from interface:Resource获取资源名,例如文件资源的资源名为文件名 -
getUrl
Description copied from interface:Resource获得解析后的URL,无对应URL的返回null -
size
public long size()Description copied from interface:Resource获取资源大小 -
getStream
Description copied from interface:Resource获得InputStream- Specified by:
getStreamin interfaceResource- Returns:
InputStream
-
getContentType
获取自定义Content-Type类型- Returns:
- Content-Type类型
-