Package org.flywaydb.core.api
Class Location
- java.lang.Object
-
- org.flywaydb.core.api.Location
-
- All Implemented Interfaces:
Comparable<Location>
public final class Location extends Object implements Comparable<Location>
A location to load migrations from.
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILESYSTEM_PREFIXThe prefix for filesystem locations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Location o)booleanequals(Object o)StringgetDescriptor()StringgetPath()StringgetPrefix()inthashCode()booleanisClassPath()Checks whether this denotes a location on the classpath.booleanisFileSystem()Checks whether this denotes a location on the filesystem.booleanisParentOf(Location other)Checks whether this location is a parent of this other location.StringtoString()
-
-
-
Field Detail
-
FILESYSTEM_PREFIX
public static final String FILESYSTEM_PREFIX
The prefix for filesystem locations.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Location
public Location(String descriptor)
Creates a new location.- Parameters:
descriptor- The location descriptor.
-
-
Method Detail
-
isClassPath
public boolean isClassPath()
Checks whether this denotes a location on the classpath.- Returns:
trueif it does,falseif it doesn't.
-
isFileSystem
public boolean isFileSystem()
Checks whether this denotes a location on the filesystem.- Returns:
trueif it does,falseif it doesn't.
-
isParentOf
public boolean isParentOf(Location other)
Checks whether this location is a parent of this other location.- Parameters:
other- The other location.- Returns:
trueif it is,falseif it isn't.
-
getPrefix
public String getPrefix()
- Returns:
- The prefix part of the location. Can be either classpath: or filesystem:.
-
getPath
public String getPath()
- Returns:
- The path part of the location.
-
getDescriptor
public String getDescriptor()
- Returns:
- The complete location descriptor.
-
compareTo
public int compareTo(Location o)
- Specified by:
compareToin interfaceComparable<Location>
-
-