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.File
ResourceFile 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 boolean
equals(java.lang.Object obj)
boolean
exists()
java.io.InputStream
getInputStream()
Getter for an input stream to read this resource file.ResourceFile
getParentFile()
java.lang.String
getPath()
java.lang.String
getPathName()
Getter for the resource's path.int
hashCode()
-
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:
getPath
in classjava.io.File
-
getParentFile
public final ResourceFile getParentFile()
- Overrides:
getParentFile
in classjava.io.File
-
exists
public boolean exists()
- Overrides:
exists
in classjava.io.File
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.io.File
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.io.File
-
-