com.agimatec.commons.util
Class ResourceUtils

java.lang.Object
  extended by com.agimatec.commons.util.ResourceUtils

public class ResourceUtils
extends Object

Description:
User: roman.stumm
Date: 29.03.2010
Time: 11:23:03
viaboxx GmbH, 2010


Constructor Summary
ResourceUtils()
           
 
Method Summary
static Collection<String> getResources(String resourceDir)
           
static Collection<String> getURLResources(URL dirURL)
          Reads the URL contents into a list, can read jars (jar:file:path!
static List<String> readLines(BufferedReader reader)
          Reads the reader into a list of Strings, with one entry for each line.
static List<String> readLines(URL url)
          Reads the URL contents into a list, with one element for each line.
 
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

readLines

public static List<String> readLines(URL url)
                              throws IOException
Reads the URL contents into a list, with one element for each line.

Parameters:
url - a URL
Returns:
a List of lines
Throws:
IOException - if an IOException occurs.
Since:
1.6.8

readLines

public static List<String> readLines(BufferedReader reader)
                              throws IOException
Reads the reader into a list of Strings, with one entry for each line. The reader is closed before this method returns.

Parameters:
reader - a Reader
Returns:
a List of lines
Throws:
IOException - if an IOException occurs.
Since:
1.0

getResources

public static Collection<String> getResources(String resourceDir)
                                       throws IOException
Throws:
IOException

getURLResources

public static Collection<String> getURLResources(URL dirURL)
                                          throws IOException
Reads the URL contents into a list, can read jars (jar:file:path!package) and directories (file:path/package)

Parameters:
dirURL - a URL (a jar or file)
Returns:
a List or Set of lines
Throws:
IOException - if an IOException occurs.


Copyright © 2008-2012. All Rights Reserved.