Package org.apache.jena.dboe.base.file
Class Location
- java.lang.Object
-
- org.apache.jena.dboe.base.file.Location
-
public class Location extends java.lang.ObjectWrapper for a file system directory; can create filenames in that directory. Enforces some simple consistency policies and provides a "typed string" for a filename to reduce errors.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringabsolute(java.lang.String filename)Return an absolute filename where relative names are resolved from the locationjava.lang.Stringabsolute(java.lang.String filename, java.lang.String extension)Return an absolute filename where relative names are resolved from the locationstatic Locationcreate(java.lang.String directoryName)Return a location for a directory on diskstatic Locationcreate(java.nio.file.Path directoryName)Return a location for a directory on diskbooleanequals(java.lang.Object obj)booleanexists()Does the location exist (and it a directory, and is accessible)booleanexists(java.lang.String filename)booleanexists(java.lang.String filename, java.lang.String ext)java.lang.StringgetDirectoryPath()MetaFilegetMetaFile()java.lang.StringgetPath(java.lang.String filename)Return the name of the file relative to this locationjava.lang.StringgetPath(java.lang.String filename, java.lang.String ext)Return the name of the file, and extension, relative to this locationjava.lang.StringgetSubDirectory(java.lang.String dirname)LocationgetSubLocation(java.lang.String dirname)inthashCode()booleanisMem()booleanisMemUnique()static Locationmem()Return a fresh memory location : always unique, never .equals to another location.static Locationmem(java.lang.String name)Return a memory location with a namejava.lang.StringtoString()
-
-
-
Method Detail
-
mem
public static Location mem()
Return a fresh memory location : always unique, never .equals to another location.
-
mem
public static Location mem(java.lang.String name)
Return a memory location with a name
-
create
public static Location create(java.lang.String directoryName)
Return a location for a directory on disk
-
create
public static Location create(java.nio.file.Path directoryName)
Return a location for a directory on disk
-
getDirectoryPath
public java.lang.String getDirectoryPath()
-
getMetaFile
public MetaFile getMetaFile()
-
isMem
public boolean isMem()
-
isMemUnique
public boolean isMemUnique()
-
getSubLocation
public Location getSubLocation(java.lang.String dirname)
-
getSubDirectory
public java.lang.String getSubDirectory(java.lang.String dirname)
-
absolute
public java.lang.String absolute(java.lang.String filename, java.lang.String extension)Return an absolute filename where relative names are resolved from the location
-
absolute
public java.lang.String absolute(java.lang.String filename)
Return an absolute filename where relative names are resolved from the location
-
exists
public boolean exists()
Does the location exist (and it a directory, and is accessible)
-
exists
public boolean exists(java.lang.String filename)
-
exists
public boolean exists(java.lang.String filename, java.lang.String ext)
-
getPath
public java.lang.String getPath(java.lang.String filename)
Return the name of the file relative to this location
-
getPath
public java.lang.String getPath(java.lang.String filename, java.lang.String ext)Return the name of the file, and extension, relative to this location
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-