com.googlecode.flyway.core.util
Class ClassPathResource

java.lang.Object
  extended by com.googlecode.flyway.core.util.ClassPathResource
All Implemented Interfaces:
java.lang.Comparable<ClassPathResource>

public class ClassPathResource
extends java.lang.Object
implements java.lang.Comparable<ClassPathResource>

A resource on the classpath.


Constructor Summary
ClassPathResource(java.lang.String location)
          Creates a new ClassPathResource.
 
Method Summary
 int compareTo(ClassPathResource o)
           
 boolean equals(java.lang.Object o)
           
 boolean exists()
          Checks whether this resource exists.
 java.lang.String getFilename()
           
 java.lang.String getLocation()
           
 java.lang.String getLocationOnDisk()
          Retrieves the location of this resource on disk.
 int hashCode()
           
 java.lang.String loadAsString(java.lang.String encoding)
          Loads this resource as a string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathResource

public ClassPathResource(java.lang.String location)
Creates a new ClassPathResource.

Parameters:
location - The location of the resource on the classpath.
Method Detail

getLocation

public java.lang.String getLocation()
Returns:
The location of the resource on the classpath.

getLocationOnDisk

public java.lang.String getLocationOnDisk()
Retrieves the location of this resource on disk.

Returns:
The location of this resource on disk.

loadAsString

public java.lang.String loadAsString(java.lang.String encoding)
Loads this resource as a string.

Parameters:
encoding - The encoding to use.
Returns:
The string contents of the resource.

getFilename

public java.lang.String getFilename()
Returns:
The filename of this resource.

exists

public boolean exists()
Checks whether this resource exists.

Returns:
true if it exists, false if not.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(ClassPathResource o)
Specified by:
compareTo in interface java.lang.Comparable<ClassPathResource>


Copyright © 2012. All Rights Reserved.