public interface IResourceHandle
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BLOB_LOCAL_KEY |
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(IResourceHandle src,
IResourceHandle target)
Copy the attached resource content between 2 model objects.
|
java.nio.file.Path |
extractInto(java.nio.file.Path dir)
Copy the resource in a file in the given directory.
|
java.net.URI |
getLocation()
Get the location of the resource.
|
java.io.InputStream |
read()
Open a read stream.
|
void |
setAuthenticationData(org.modelio.vbasic.auth.IAuthData auth)
Set the authentication data that may be needed to access the resource.
|
java.io.OutputStream |
write()
Open a write stream on the resource.
|
static final java.lang.String BLOB_LOCAL_KEY
java.io.InputStream read()
throws java.io.IOException
The caller has to close the stream, usually with a try-with-resource statement.
java.io.IOException - on I/O failure.java.io.OutputStream write()
throws java.io.IOException
The caller has to close the stream, usually with a try-with-resource statement.
java.io.IOException - on I/O failure.void setAuthenticationData(org.modelio.vbasic.auth.IAuthData auth)
auth - the authentication data.java.nio.file.Path extractInto(java.nio.file.Path dir)
throws java.io.IOException
dir - the target directory.java.io.IOException - the created file.static void copy(IResourceHandle src, IResourceHandle target) throws java.io.IOException
Beware the target resource content will be overwritten, even if it the resource was an external reference.
src - the source resource handle.target - the target resource handle.java.io.IOException - on I/O failurejava.net.URI getLocation()
Returns null for an embedded resource.