public class ResourceUtil
extends org.springframework.util.ResourceUtils
| Modifier and Type | Field and Description |
|---|---|
static String |
FTP_URL_PREFIX |
CLASSPATH_URL_PREFIX, FILE_URL_PREFIX, JAR_FILE_EXTENSION, JAR_URL_PREFIX, JAR_URL_SEPARATOR, URL_PROTOCOL_FILE, URL_PROTOCOL_JAR, URL_PROTOCOL_VFS, URL_PROTOCOL_VFSFILE, URL_PROTOCOL_VFSZIP, URL_PROTOCOL_WAR, URL_PROTOCOL_WSJAR, URL_PROTOCOL_ZIP, WAR_URL_PREFIX, WAR_URL_SEPARATOR| Constructor and Description |
|---|
ResourceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getAsString(String resourceLocation)
读取资源文件为字符串
|
static org.springframework.core.io.Resource |
getResource(String resourceLocation)
获取资源
支持一下协议:
1. classpath:
2. file:
3. ftp:
4. http: and https:
6.
|
public static final String FTP_URL_PREFIX
public static org.springframework.core.io.Resource getResource(String resourceLocation) throws IOException
支持一下协议:
1. classpath: 2. file: 3. ftp: 4. http: and https: 6. C:/dir1/ and /Users/lcm
resourceLocation - 资源路径IOException - IOExceptionCopyright © 2024. All rights reserved.