Class LocatorFile
- java.lang.Object
-
- org.apache.jena.riot.system.stream.LocatorFile
-
- All Implemented Interfaces:
Locator
public class LocatorFile extends java.lang.Object implements Locator
Location files in the filing system. A FileLocator can have a "current directory" - this is separate from any location mapping (seeLocationMapper) as it applies only to files.
-
-
Constructor Summary
Constructors Constructor Description LocatorFile()Create a LocatorFile without a specific working directory.LocatorFile(java.lang.String dir)Create a LocatorFile that uses the argument as it's working directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)booleanexists(java.lang.String fileIRI)java.lang.StringgetName()java.lang.StringgetThisDir()booleanhasCurrentDir()inthashCode()TypedInputStreamopen(java.lang.String filenameIRI)Open anything that looks a bit like a file namejava.lang.StringtoFileName(java.lang.String filenameIRI)Processing the filename for file: or relative filename and return a filename suitable for file operations.
-
-
-
Constructor Detail
-
LocatorFile
public LocatorFile()
Create a LocatorFile without a specific working directory. Relative file names are relative to the working directory of the JVM.
-
LocatorFile
public LocatorFile(java.lang.String dir)
Create a LocatorFile that uses the argument as it's working directory.The working directory should be a UNIX style file name, (relative or absolute), not a URI.
For MS Window, if asked to
open(java.lang.String)a file name with a drive letter, the code assumes it is not relative to the working directory of thisLocatorFile.
-
-
Method Detail
-
toFileName
public java.lang.String toFileName(java.lang.String filenameIRI)
Processing the filename for file: or relative filename and return a filename suitable for file operations.
-
getThisDir
public java.lang.String getThisDir()
-
hasCurrentDir
public boolean hasCurrentDir()
-
exists
public boolean exists(java.lang.String fileIRI)
-
open
public TypedInputStream open(java.lang.String filenameIRI)
Open anything that looks a bit like a file name
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-