Spring for Apache Hadoop

org.springframework.data.hadoop.util
Class ResourceUtils

java.lang.Object
  extended by org.springframework.data.hadoop.util.ResourceUtils

public abstract class ResourceUtils
extends java.lang.Object

Utility class for dealing or location resources for Hadoop jobs.

Author:
Costin Leau, Arjen Poutsma

Constructor Summary
ResourceUtils()
           
 
Method Summary
static java.lang.String decode(java.lang.String source)
          Decodes the given encoded source String into an URI.
static org.springframework.core.io.Resource findContainingJar(java.lang.Class<?> clazz)
          Locates the jar (within the classpath) containing the given class.
static org.springframework.core.io.Resource findContainingJar(java.lang.ClassLoader loader, java.lang.String resourceName)
          Locates a jar (within the classpath) containing the given resource.
 
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

findContainingJar

public static org.springframework.core.io.Resource findContainingJar(java.lang.Class<?> clazz)
Locates the jar (within the classpath) containing the given class. As this method requires loading a class, it's recommended to use findContainingJar(ClassLoader, String) instead.

Parameters:
clazz - the class to look for
Returns:
the containing jar.

findContainingJar

public static org.springframework.core.io.Resource findContainingJar(java.lang.ClassLoader loader,
                                                                     java.lang.String resourceName)
Locates a jar (within the classpath) containing the given resource.

Parameters:
loader - class loader to use for locating the jar
resourceName - resource to look for
Returns:
the containing jar

decode

public static java.lang.String decode(java.lang.String source)
Decodes the given encoded source String into an URI. Based on the following rules:

Parameters:
source - the source string
Returns:
the decoded URI
Throws:
java.io.UnsupportedEncodingException - when the given encoding parameter is not supported
See Also:
URLDecoder.decode(String, String)

Spring for Apache Hadoop