| Constructor and Description |
|---|
FileResource(File file) |
FileResource(File file,
Namespace namespace) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Resource childResource)
Checks if the passed-in resource is a child of
this resource. |
Resource |
createRelative(String relativePath,
Namespace namespace)
Creates a resource relative to this resource.
|
boolean |
delete()
Deletes physical resource that
this resource points at. |
boolean |
equals(Object obj) |
InputStream |
getInputStream()
Returns input stream for the resource.
|
Namespace |
getNamespace()
Returns namespace of current resource.
|
OutputStream |
getOutputStream()
Returns output stream for the resource if it is writable,
null otherwise. |
String |
getRelativePath(Resource childResource)
Returns relative path from
this resource to the child one, or
null if such path doesn't exist. |
int |
hashCode() |
String |
toString() |
createRelative, createRelativepublic FileResource(File file)
public InputStream getInputStream() throws IOException
ResourcegetInputStream in interface ResourceIOException - when input stream cannot be provided.public OutputStream getOutputStream() throws IOException
Resourcenull otherwise.getOutputStream in interface ResourceIOException - when output stream cannot be provided.public boolean delete()
throws IOException
Resourcethis resource points at.delete in interface Resourcetrue if successfully deleted or false otherwise.IOException - when an error happened during deletion.public boolean contains(Resource childResource)
Resourcethis resource.public String getRelativePath(Resource childResource)
Resourcethis resource to the child one, or
null if such path doesn't exist.getRelativePath in interface ResourcechildResource - child resource of this resource.public Resource createRelative(String relativePath, Namespace namespace)
ResourcecreateRelative in interface ResourcerelativePath - path relative to this resource.namespace - name space of the created resource.public Namespace getNamespace()
ResourcegetNamespace in interface ResourceCopyright © 2023 CURS. All rights reserved.