org.kuali.maven.common
Class ResourceUtils

java.lang.Object
  extended by org.kuali.maven.common.ResourceUtils

public class ResourceUtils
extends Object


Constructor Summary
ResourceUtils()
           
 
Method Summary
 void copy(String location, String filename)
          Copy a URL location to the local file system
 InputStream getInputStream(String location)
          Given a location that can represent either a file on the file system or a Spring style resource, return an InputStream.
 String read(String location)
          Read the contents of the URL location into a string
 void write(String filename, String contents)
          Write the string to the file system
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceUtils

public ResourceUtils()
Method Detail

getInputStream

public InputStream getInputStream(String location)
                           throws IOException
Given a location that can represent either a file on the file system or a Spring style resource, return an InputStream. The method checks the file system first. If no file exists, it uses Spring resource loading to obtain an InputStream

Throws:
IOException

copy

public void copy(String location,
                 String filename)
          throws IOException
Copy a URL location to the local file system

Throws:
IOException

write

public void write(String filename,
                  String contents)
           throws IOException
Write the string to the file system

Throws:
IOException

read

public String read(String location)
            throws IOException
Read the contents of the URL location into a string

Throws:
IOException


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