com.atlassian.confluence.it.resource
Class Classpath

java.lang.Object
  extended by com.atlassian.confluence.it.resource.Classpath

public class Classpath
extends Object

Provides access to resources on the integration test classpath.


Constructor Summary
Classpath()
           
 
Method Summary
static byte[] getBytes(String resourcePath)
          Returns a byte array with the data from a classpath resource.
static File getFile(String resourcePath)
          Loads a resource from the classpath into a temporary file and returns that file.
static URL getResource(String resourcePath)
           
static InputStream getResourceAsStream(String resourcePath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Classpath

public Classpath()
Method Detail

getFile

public static File getFile(String resourcePath)
Loads a resource from the classpath into a temporary file and returns that file.

Returns:
a File containing the contents of the classpath resource.
Throws:
RuntimeException - if an error occurred copying the classpath resource to a temporary location

getBytes

public static byte[] getBytes(String resourcePath)
Returns a byte array with the data from a classpath resource.

Returns:
a byte array with the contents of the classpath resource.
Throws:
RuntimeException - if an error occurred loading the classpath resource

getResourceAsStream

public static InputStream getResourceAsStream(String resourcePath)

getResource

public static URL getResource(String resourcePath)


Copyright © 2003-2012 Atlassian. All Rights Reserved.