public class PaaSResourceUtils
extends org.springframework.util.ResourceUtils
| Modifier and Type | Field and Description |
|---|---|
static String |
PROPERTIES_SUFFIX |
static String |
XML_SUFFIX |
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 |
|---|
PaaSResourceUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<org.springframework.core.io.Resource> |
getResources(String... locationPatterns)
失败,则返回空列表
|
static org.springframework.core.io.Resource[] |
getResources(String locationPattern)
失败,则返回空数组
|
static List<org.springframework.core.io.Resource> |
getSortedPorperties(String locationPattern) |
static List<org.springframework.core.io.Resource> |
getSortedResources(String locationPattern,
String suffix) |
static List<org.springframework.core.io.Resource> |
getSortedXmls(String locationPattern) |
static Properties |
loadMergedProperties(String locationPattern) |
static void |
sortProperties(List<org.springframework.core.io.Resource> resList) |
static void |
sortResources(List<org.springframework.core.io.Resource> resList,
String suffix)
文件同名时,jar的优先级比较低
jar: xxx.xml
jar: xxx.model.xml
file:xxx.xml
调用者保证,所有res的后缀都是suffix
file文件应该只有一个,因为放在目录中的配置文件,应该是最终的部署定制文件
此时,还分多个,是不合适的
|
static void |
sortXmls(List<org.springframework.core.io.Resource> resList) |
public static final String PROPERTIES_SUFFIX
public static final String XML_SUFFIX
public static org.springframework.core.io.Resource[] getResources(String locationPattern)
public static List<org.springframework.core.io.Resource> getResources(String... locationPatterns)
public static void sortResources(List<org.springframework.core.io.Resource> resList, String suffix)
public static void sortProperties(List<org.springframework.core.io.Resource> resList)
public static void sortXmls(List<org.springframework.core.io.Resource> resList)
public static List<org.springframework.core.io.Resource> getSortedResources(String locationPattern, String suffix)
public static List<org.springframework.core.io.Resource> getSortedPorperties(String locationPattern)
public static Properties loadMergedProperties(String locationPattern) throws Exception
ExceptionCopyright © 2017–2021 The Apache Software Foundation. All rights reserved.