Package ai.libs.jaicore.basic
Class ResourceFile
- java.lang.Object
-
- java.io.File
-
- ai.libs.jaicore.basic.ResourceFile
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<java.io.File>
public class ResourceFile extends java.io.FileResourceFile may be used to encapsulate files to be loaded from resources, i.e. from the build directory or from inside of a jar.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceFile(ResourceFile baseFile, java.lang.String pathname)C'tor for instantiating a resource file relative to another resource file.ResourceFile(java.lang.String pathname)C'tor for instantiating a resource file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)booleanexists()java.io.InputStreamgetInputStream()Getter for an input stream to read this resource file.ResourceFilegetParentFile()java.lang.StringgetPath()java.lang.StringgetPathName()Getter for the resource's path.inthashCode()-
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getTotalSpace, getUsableSpace, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
-
-
-
-
Constructor Detail
-
ResourceFile
public ResourceFile(java.lang.String pathname)
C'tor for instantiating a resource file.- Parameters:
pathname- The path to the resource
-
ResourceFile
public ResourceFile(ResourceFile baseFile, java.lang.String pathname)
C'tor for instantiating a resource file relative to another resource file.- Parameters:
baseFile- The base file to which the relative path is to be considered.pathname- The relative path to the resource with respect to the base file.
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream()
Getter for an input stream to read this resource file.- Returns:
- The input stream to read the contents of this resource file.
-
getPathName
public final java.lang.String getPathName()
Getter for the resource's path.- Returns:
- The path of the resource file.
-
getPath
public final java.lang.String getPath()
- Overrides:
getPathin classjava.io.File
-
getParentFile
public final ResourceFile getParentFile()
- Overrides:
getParentFilein classjava.io.File
-
exists
public boolean exists()
- Overrides:
existsin classjava.io.File
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.io.File
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.io.File
-
-