public class ResourceUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PREFIX |
static String |
SUFFIX |
Constructor and Description |
---|
ResourceUtil() |
Modifier and Type | Method and Description |
---|---|
protected void |
copy(String location,
File file) |
void |
copyDirectory(String srcLoc,
File dstDir) |
void |
createLocalDirectory(File dir) |
protected void |
createOrVerifyAsNeeded(ResourceItem item) |
boolean |
exists(String location)
Return true if
location is a file on the local file system or points to a resource Spring's resource loading API can
understand and locate. |
protected void |
filterThenCopy(String location,
File file,
Properties properties) |
File |
getFile(String location) |
String |
getFilteredContent(String s,
Properties properties) |
InputStream |
getInputStream(String location) |
Properties |
getProperties(List<String> locations) |
Properties |
getProperties(String location) |
Properties |
getPropertiesFromSystemProperty(String systemProperty) |
String |
getProperty(Properties props,
String defaultPrefix,
String envPrefix,
String key) |
String |
getSystemProperty(String property,
String defaultValue) |
boolean |
isLocalDirectory(String location) |
protected boolean |
isValidExistingResource(ResourceItem item) |
void |
setSystemProperty(String property,
String value) |
void |
validate(ResourceItem item) |
public static final String PREFIX
public static final String SUFFIX
public ResourceUtil()
public String getProperty(Properties props, String defaultPrefix, String envPrefix, String key)
public String getSystemProperty(String property, String defaultValue)
public void validate(ResourceItem item)
protected void createOrVerifyAsNeeded(ResourceItem item)
public void setSystemProperty(String property, String value)
protected void filterThenCopy(String location, File file, Properties properties) throws IOException
IOException
protected void copy(String location, File file) throws IOException
IOException
protected boolean isValidExistingResource(ResourceItem item)
public Properties getPropertiesFromSystemProperty(String systemProperty) throws IOException
IOException
public Properties getProperties(List<String> locations) throws IOException
IOException
public Properties getProperties(String location) throws IOException
IOException
public InputStream getInputStream(String location) throws IOException
IOException
public void createLocalDirectory(File dir)
public boolean isLocalDirectory(String location)
public boolean exists(String location)
location
is a file on the local file system or points to a resource Spring's resource loading API can
understand and locate. For example, classpath:config.properties
. Return false otherwise.public String getFilteredContent(String s, Properties properties)
public File getFile(String location) throws IOException
IOException
public void copyDirectory(String srcLoc, File dstDir) throws IOException
IOException
Copyright © 2004–2015 The Kuali Foundation. All rights reserved.