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
- IOException
public WxMediaResource(File file)
file
- public String getDescription()
public InputStream getInputStream() throws IOException
IOException
public URL getURL() throws IOException
getURL
in interface org.springframework.core.io.Resource
getURL
in class org.springframework.core.io.AbstractResource
IOException
public File getFile() throws IOException
getFile
in interface org.springframework.core.io.Resource
getFile
in class org.springframework.core.io.AbstractResource
IOException
public File getFile(String path) throws IOException
IOException
public long contentLength() throws IOException
contentLength
in interface org.springframework.core.io.Resource
contentLength
in class org.springframework.core.io.AbstractResource
IOException
getInputStream()
public org.springframework.core.io.Resource createRelative(String mediaId) throws IOException
createRelative
in interface org.springframework.core.io.Resource
createRelative
in class org.springframework.core.io.AbstractResource
IOException
public String getFilename()
null
,
assuming that this resource type does not have a filename.getFilename
in interface org.springframework.core.io.Resource
getFilename
in class org.springframework.core.io.AbstractResource
public 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.