|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.io.impl.BaseResource
org.drools.io.impl.FileSystemResource
public class FileSystemResource
Borrowed gratuitously from Spring under ASL2.0.
Constructor Summary | |
---|---|
FileSystemResource()
|
|
FileSystemResource(File file)
Create a new FileSystemResource from a File handle. |
|
FileSystemResource(String path)
Create a new FileSystemResource from a file path. |
Method Summary | |
---|---|
boolean |
equals(Object object)
|
File |
getFile()
|
InputStream |
getInputStream()
This implementation opens a FileInputStream for the underlying file. |
long |
getLastModified()
|
long |
getLastRead()
|
Reader |
getReader()
|
URL |
getURL()
This implementation returns a URL for the underlying file. |
int |
hashCode()
|
boolean |
hasURL()
|
boolean |
isDirectory()
|
Collection<org.drools.io.Resource> |
listResources()
|
void |
readExternal(ObjectInput in)
|
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class org.drools.io.impl.BaseResource |
---|
getConfiguration, getDescription, getName, getResourceType, setConfiguration, setDescription, setName, setResourceType |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.drools.io.internal.InternalResource |
---|
getConfiguration, getDescription, getName, getResourceType, setConfiguration, setDescription, setName, setResourceType |
Constructor Detail |
---|
public FileSystemResource()
public FileSystemResource(File file)
Note: When building relative resources via #createRelative
,
the relative path will apply at the same directory level:
e.g. new File("C:/dir1"), relative path "dir2" -> "C:/dir2"!
If you prefer to have relative paths built underneath the given root
directory, use the constructor with a file path
to append a trailing slash to the root path: "C:/dir1/", which
indicates this directory as root for all relative paths.
file
- a File handlepublic FileSystemResource(String path)
Note: When building relative resources via #createRelative
,
it makes a difference whether the specified resource base path here
ends with a slash or not. In the case of "C:/dir1/", relative paths
will be built underneath that root: e.g. relative path "dir2" ->
"C:/dir1/dir2". In the case of "C:/dir1", relative paths will apply
at the same directory level: relative path "dir2" -> "C:/dir2".
path
- a file pathMethod Detail |
---|
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public InputStream getInputStream() throws IOException
getInputStream
in interface org.drools.io.Resource
IOException
FileInputStream
public Reader getReader() throws IOException
getReader
in interface org.drools.io.Resource
IOException
public File getFile()
public boolean isDirectory()
isDirectory
in interface InternalResource
public Collection<org.drools.io.Resource> listResources()
listResources
in interface InternalResource
public URL getURL() throws IOException
getURL
in interface InternalResource
IOException
File.toURI()
public boolean hasURL()
hasURL
in interface InternalResource
public long getLastModified()
getLastModified
in interface InternalResource
public long getLastRead()
getLastRead
in interface InternalResource
public String toString()
toString
in class Object
public boolean equals(Object object)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |