public interface Resource
| Modifier and Type | Method and Description |
|---|---|
default boolean |
contains(Resource childResource)
Checks if the passed-in resource is a child of
this resource. |
default Resource |
createRelative(Namespace namespace)
Creates a resource relative to this resource.
|
default Resource |
createRelative(String relativePath)
Creates a resource relative to this resource.
|
Resource |
createRelative(String relativePath,
Namespace namespace)
Creates a resource relative to this resource.
|
default boolean |
delete()
Deletes physical resource that
this resource points at. |
InputStream |
getInputStream()
Returns input stream for the resource.
|
Namespace |
getNamespace()
Returns namespace of current resource.
|
default OutputStream |
getOutputStream()
Returns output stream for the resource if it is writable,
null otherwise. |
default String |
getRelativePath(Resource childResource)
Returns relative path from
this resource to the child one, or
null if such path doesn't exist. |
InputStream getInputStream() throws IOException
IOException - when input stream cannot be provided.default OutputStream getOutputStream() throws IOException
null otherwise.IOException - when output stream cannot be provided.default boolean delete()
throws IOException
this resource points at.true if successfully deleted or false otherwise.IOException - when an error happened during deletion.default boolean contains(Resource childResource)
this resource.childResource - the checked resource.default String getRelativePath(Resource childResource)
this resource to the child one, or
null if such path doesn't exist.childResource - child resource of this resource.default Resource createRelative(Namespace namespace) throws IOException
namespace - name space path relative to this resource.IOException - when resource creation failed.default Resource createRelative(String relativePath) throws IOException
relativePath - path relative to this resource.IOException - when resource creation failed.Resource createRelative(String relativePath, Namespace namespace) throws IOException
relativePath - path relative to this resource.namespace - name space of the created resource.IOException - when resource creation failed.Namespace getNamespace()
Copyright © 2020 CURS. All rights reserved.