public abstract class ResourceUtil
extends org.springframework.util.ResourceUtils
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| 构造器和说明 |
|---|
ResourceUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.springframework.core.io.Resource |
createResource(String resourceLocation)
根据资源位置创建资源
|
static org.springframework.core.io.Resource |
createResource(String resourceLocation,
boolean alwaysCreate)
根据资源位置创建资源
|
static org.springframework.core.io.Resource |
createResourceByClasspath(String resourceLocation,
boolean alwaysCreate)
根据资源位置创建资源(使用classpath模式)
|
static org.springframework.core.io.Resource |
createResourceByFilesystem(String resourceLocation,
boolean alwaysCreate)
根据资源位置创建资源(使用filesystem模式)
|
static org.springframework.core.io.Resource |
getResource(String resourceLocation)
根据资源位置获取资源
|
static org.springframework.core.io.Resource |
getResourceByClasspath(String resourceLocation)
根据资源位置获取资源(使用classpath模式)
|
static org.springframework.core.io.Resource |
getResourceByFilesystem(String resourceLocation)
根据资源位置获取资源(使用filesystem模式)
|
static String |
md5(org.springframework.core.io.Resource resource)
获取文件输入流的md5值
|
static String |
plusUUIDFolder(String fileName)
增加UUID文件夹
|
static String |
sha256(org.springframework.core.io.Resource resource) |
public static org.springframework.core.io.Resource getResource(String resourceLocation)
resourceLocation - 资源位置public static org.springframework.core.io.Resource getResourceByClasspath(String resourceLocation)
resourceLocation - 资源位置public static org.springframework.core.io.Resource getResourceByFilesystem(String resourceLocation)
resourceLocation - 资源位置public static org.springframework.core.io.Resource createResource(String resourceLocation) throws IOException
resourceLocation - 资源位置IOExceptionpublic static org.springframework.core.io.Resource createResource(String resourceLocation, boolean alwaysCreate) throws IOException
resourceLocation - 资源位置alwaysCreate - 是否始终创建IOExceptionpublic static org.springframework.core.io.Resource createResourceByClasspath(String resourceLocation, boolean alwaysCreate) throws IOException
resourceLocation - 资源位置IOExceptionpublic static org.springframework.core.io.Resource createResourceByFilesystem(String resourceLocation, boolean alwaysCreate) throws IOException
resourceLocation - 资源位置IOExceptionpublic static String md5(org.springframework.core.io.Resource resource) throws IOException
IOExceptionpublic static String sha256(org.springframework.core.io.Resource resource) throws IOException
IOExceptionCopyright © 2024. All rights reserved.