public interface ILoadPaths
The Venice functions 'load-file' and 'load-resource' can be
bound to load files and resources from restricted paths only.
Load paths are part of Venice's Sandbox to control where
files can be loaded from.
LoadPathsFactory| Modifier and Type | Method and Description |
|---|---|
java.io.BufferedReader |
getBufferedReader(java.io.File file,
java.nio.charset.Charset charset)
Returns a
BufferedReader for a file from the load paths |
java.io.InputStream |
getInputStream(java.io.File file)
Returns an
InputStream for a file from the load paths |
java.io.OutputStream |
getOutputStream(java.io.File file,
java.nio.file.OpenOption... options)
Returns an
OutputStream for a file from the load paths |
java.util.List<java.io.File> |
getPaths() |
boolean |
isDirectoryOnLoadPath(java.io.File file)
Returns
true if the directory exists on the load path |
boolean |
isOnLoadPath(java.io.File file)
Checks if the passed file is within the load paths.
|
boolean |
isRegularFileOnLoadPath(java.io.File file)
Returns
true if the regular file exists on the load path |
boolean |
isUnlimitedAccess() |
java.nio.ByteBuffer |
loadBinaryResource(java.io.File file)
Loads a binary resources file from the load paths
|
java.lang.String |
loadTextResource(java.io.File file,
java.nio.charset.Charset charset)
Loads a text resources file from the load paths
|
java.lang.String |
loadVeniceFile(java.io.File file)
Load a Venice script file from the load paths
|
java.lang.String loadVeniceFile(java.io.File file)
file - A Venice script file to load. Adds a '.venice' file
extension implicitly if missing.null if not foundjava.nio.ByteBuffer loadBinaryResource(java.io.File file)
file - A file to load.null if not foundjava.lang.String loadTextResource(java.io.File file,
java.nio.charset.Charset charset)
file - A file to load.charset - an optional text encoding like 'UTF-8'.
'UTF-8' on passing nullnull if not foundjava.io.InputStream getInputStream(java.io.File file)
InputStream for a file from the load pathsfile - A file to return an InputStream.InputStream or null if not foundjava.io.BufferedReader getBufferedReader(java.io.File file,
java.nio.charset.Charset charset)
BufferedReader for a file from the load pathsfile - A file to return an BufferedReader.charset - an optional text encoding like 'UTF-8'.
'UTF-8' on passing nullBufferedReader or null if not foundjava.io.OutputStream getOutputStream(java.io.File file,
java.nio.file.OpenOption... options)
OutputStream for a file from the load paths
If no options are
present then this method works as if the CREATE, TRUNCATE_EXISTING,
and WRITE options are present. In other
words, it opens the file for writing, creating the file if it doesn't
exist, or initially truncating an existing regular-file to a size of
0 if it exists.
file - A file to return an BufferedReader.options - options specifying how the file is openedOutputStream or null if not foundboolean isRegularFileOnLoadPath(java.io.File file)
true if the regular file exists on the load pathfile - a filetrue if the file exists on the load pathboolean isDirectoryOnLoadPath(java.io.File file)
true if the directory exists on the load pathfile - a filetrue if the file exists on the load pathjava.util.List<java.io.File> getPaths()
ILoadPaths objectboolean isOnLoadPath(java.io.File file)
file - a file to checkboolean isUnlimitedAccess()
true if the access to files is unlimited or
false if the access is limited to the load paths.