org.kuali.ole.utility
Class ResourceUtil

java.lang.Object
  extended by org.kuali.ole.utility.ResourceUtil

public class ResourceUtil
extends Object


Constructor Summary
ResourceUtil()
           
 
Method Summary
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.
 File getFile(String location)
           
 InputStream getInputStream(String location)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceUtil

public ResourceUtil()
Method Detail

getProperty

public String getProperty(Properties props,
                          String defaultPrefix,
                          String envPrefix,
                          String key)

getSystemProperty

public String getSystemProperty(String property,
                                String defaultValue)

validate

public void validate(ResourceItem item)

createOrVerifyAsNeeded

protected void createOrVerifyAsNeeded(ResourceItem item)

setSystemProperty

public void setSystemProperty(String property,
                              String value)

copy

protected void copy(String location,
                    File file)
             throws IOException
Throws:
IOException

isValidExistingResource

protected boolean isValidExistingResource(ResourceItem item)

getPropertiesFromSystemProperty

public Properties getPropertiesFromSystemProperty(String systemProperty)
                                           throws IOException
Throws:
IOException

getProperties

public Properties getProperties(String location)
                         throws IOException
Throws:
IOException

getInputStream

public InputStream getInputStream(String location)
                           throws IOException
Throws:
IOException

createLocalDirectory

public void createLocalDirectory(File dir)

isLocalDirectory

public boolean isLocalDirectory(String location)

exists

public 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. For example, classpath:config.properties. Return false otherwise.


getFile

public File getFile(String location)

copyDirectory

public void copyDirectory(String srcLoc,
                          File dstDir)


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.