public class FileSystemResource extends BaseResource implements InternalResource, Externalizable
| Constructor and Description |
|---|
FileSystemResource() |
FileSystemResource(File file)
Create a new FileSystemResource from a File handle.
|
FileSystemResource(File file,
String encoding) |
FileSystemResource(String path)
Create a new FileSystemResource from a file path.
|
FileSystemResource(String path,
String encoding) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object) |
String |
getEncoding() |
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.kie.api.io.Resource> |
listResources() |
void |
readExternal(ObjectInput in) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
addCategory, getBytes, getCategories, getConfiguration, getDescription, getResourceType, getSourcePath, getTargetPath, setCategories, setConfiguration, setDescription, setResourceType, setSourcePath, setTargetPathclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddCategory, getBytes, getCategories, getConfiguration, getDescription, getResourceType, setCategories, setConfiguration, setDescription, setResourceTypepublic 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 pathpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizablewriteExternal in class BaseResourceIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class BaseResourceIOExceptionClassNotFoundExceptionpublic String getEncoding()
getEncoding in interface InternalResourcepublic InputStream getInputStream() throws IOException
getInputStream in interface org.kie.api.io.ResourceIOExceptionFileInputStreampublic Reader getReader() throws IOException
getReader in interface org.kie.api.io.ResourceIOExceptionpublic File getFile()
public boolean isDirectory()
isDirectory in interface InternalResourcepublic Collection<org.kie.api.io.Resource> listResources()
listResources in interface InternalResourcepublic URL getURL() throws IOException
getURL in interface InternalResourceIOExceptionFile.toURI()public boolean hasURL()
hasURL in interface InternalResourcepublic long getLastModified()
getLastModified in interface InternalResourcepublic long getLastRead()
getLastRead in interface InternalResourcepublic String toString()
toString in class BaseResourcepublic boolean equals(Object object)
equals in class BaseResourcepublic int hashCode()
hashCode in class BaseResourceCopyright © 2001–2015 JBoss by Red Hat. All rights reserved.