public class WxMediaResource
extends org.springframework.core.io.AbstractResource
| Constructor and Description |
|---|
WxMediaResource(File file)
覆盖FileSystemResource,用于兼容mediaManager中从本地文件获取的资源
是否真的需要这么多成员变量?
|
WxMediaResource(org.springframework.http.HttpInputMessage httpInputMessage)
是否真的需要这么多成员变量?
|
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength()
This implementation reads the entire InputStream to calculate the
content length.
|
org.springframework.core.io.Resource |
createRelative(String mediaId) |
byte[] |
getBody()
body只在
|
org.springframework.http.MediaType |
getContentType() |
String |
getDescription() |
File |
getFile()
我的stream用的并不好,所以有空要梳理和观察一下当前的Stream是否会出现内存泄漏
加锁防止多次写入
findBugs确实提示了这个问题,先不管吧。。
|
File |
getFile(String path) |
String |
getFilename()
This implementation always returns
null,
assuming that this resource type does not have a filename. |
org.springframework.http.HttpHeaders |
getHttpHeaders() |
InputStream |
getInputStream() |
String |
getMediaId() |
URL |
getURL() |
boolean |
isUrlMedia() |
void |
setURL(URI uri) |
public WxMediaResource(org.springframework.http.HttpInputMessage httpInputMessage)
throws IOException
httpInputMessage - IOExceptionpublic WxMediaResource(File file)
file - public String getDescription()
public InputStream getInputStream() throws IOException
IOExceptionpublic URL getURL() throws IOException
getURL in interface org.springframework.core.io.ResourcegetURL in class org.springframework.core.io.AbstractResourceIOExceptionpublic File getFile() throws IOException
getFile in interface org.springframework.core.io.ResourcegetFile in class org.springframework.core.io.AbstractResourceIOExceptionpublic File getFile(String path) throws IOException
IOExceptionpublic long contentLength()
throws IOException
contentLength in interface org.springframework.core.io.ResourcecontentLength in class org.springframework.core.io.AbstractResourceIOExceptiongetInputStream()public org.springframework.core.io.Resource createRelative(String mediaId) throws IOException
createRelative in interface org.springframework.core.io.ResourcecreateRelative in class org.springframework.core.io.AbstractResourceIOExceptionpublic String getFilename()
null,
assuming that this resource type does not have a filename.getFilename in interface org.springframework.core.io.ResourcegetFilename in class org.springframework.core.io.AbstractResourcepublic byte[] getBody()
public org.springframework.http.MediaType getContentType()
public org.springframework.http.HttpHeaders getHttpHeaders()
public boolean isUrlMedia()
public String getMediaId()
public void setURL(URI uri)
Copyright © 2018 Guangshan Technology, Inc.. All rights reserved.