public interface ExtensionLibrariesManager
ExtensionLibrariesManager provides methods to read, list and update server-side XQuery modules that reside in the REST instanance’s modules database. It can be used for any assets or code that an application needs to store on the server as part of the server-side logic.
| Modifier and Type | Method and Description |
|---|---|
void |
delete(ExtensionLibraryDescriptor libraryDescriptor)
Removes a library asset from the server.
|
void |
delete(String libraryPath)
Removes a library asset from the server.
|
ExtensionLibraryDescriptor[] |
list()
Lists all of the library files that are installed on the server.
|
ExtensionLibraryDescriptor[] |
list(String directory)
Lists all of the library files in one directory (infinite depth) on the server.
|
<T> T |
read(ExtensionLibraryDescriptor libraryDescriptor,
Class<T> as)
Reads the contents of a library asset as an object of an IO class.
|
<T extends AbstractReadHandle> |
read(ExtensionLibraryDescriptor libraryDescriptor,
T readHandle)
Reads the contents of a library asset into a handle.
|
<T extends AbstractReadHandle> |
read(String libraryPath,
T readHandle)
Reads the contents of a library asset into a handle.
|
<T> T |
readAs(String libraryPath,
Class<T> as)
Reads the contents of a library asset as an object of an IO class.
|
void |
write(ExtensionLibraryDescriptor libraryDescriptor,
AbstractWriteHandle contentHandle)
Writes the contents of a handle to the provided path on the REST server.
|
void |
write(String libraryPath,
AbstractWriteHandle contentHandle)
Writes the contents of a handle to the provided path on the REST server.
|
void |
writeAs(ExtensionLibraryDescriptor libraryDescriptor,
Object content)
Writes the contents of a handle to the provided path on the REST server as an object of an IO class.
|
void |
writeAs(String libraryPath,
Object content)
Writes the contents of a handle to the provided path on the REST server as an object of an IO class.
|
ExtensionLibraryDescriptor[] list() throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Lists all of the library files that are installed on the server.
ResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionExtensionLibraryDescriptor[] list(String directory) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Lists all of the library files in one directory (infinite depth) on the server.
directory - The directory to list.ResourceNotFoundExceptionForbiddenUserExceptionFailedRequestException<T> T readAs(String libraryPath, Class<T> as) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the contents of a library asset as an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of object that will be returned by the handle registered for itlibraryPath - the path to the libraryas - the IO class for reading the library assetResourceNotFoundExceptionForbiddenUserExceptionFailedRequestException<T> T read(ExtensionLibraryDescriptor libraryDescriptor, Class<T> as) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the contents of a library asset as an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of AbstractReadHandle to returnlibraryDescriptor - a descriptor that locates the libraryas - the IO class for reading the library assetResourceNotFoundExceptionForbiddenUserExceptionFailedRequestException<T extends AbstractReadHandle> T read(String libraryPath, T readHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the contents of a library asset into a handle.
T - the type of AbstractReadHandle to returnlibraryPath - the path to the libraryreadHandle - a handle for reading the contents of the fileResourceNotFoundExceptionForbiddenUserExceptionFailedRequestException<T extends AbstractReadHandle> T read(ExtensionLibraryDescriptor libraryDescriptor, T readHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the contents of a library asset into a handle.
T - the type of AbstractReadHandle to returnlibraryDescriptor - a descriptor that locates the library.readHandle - A handle for reading the contents of the file.ResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid writeAs(String libraryPath, Object content) throws ResourceNotFoundException, ResourceNotResendableException, ForbiddenUserException, FailedRequestException
Writes the contents of a handle to the provided path on the REST server as an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
libraryPath - The path at which to install the library.content - an IO representation of the library assetResourceNotFoundExceptionResourceNotResendableExceptionForbiddenUserExceptionFailedRequestExceptionvoid writeAs(ExtensionLibraryDescriptor libraryDescriptor, Object content) throws ResourceNotFoundException, ResourceNotResendableException, ForbiddenUserException, FailedRequestException
Writes the contents of a handle to the provided path on the REST server as an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
libraryDescriptor - The descriptory which locates where to install the library.content - an IO representation of the library assetResourceNotFoundExceptionResourceNotResendableExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(String libraryPath, AbstractWriteHandle contentHandle) throws ResourceNotFoundException, ResourceNotResendableException, ForbiddenUserException, FailedRequestException
Writes the contents of a handle to the provided path on the REST server.
libraryPath - The path at which to install the library.contentHandle - The handle containing the contents of the library.ResourceNotFoundExceptionResourceNotResendableExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(ExtensionLibraryDescriptor libraryDescriptor, AbstractWriteHandle contentHandle) throws ResourceNotFoundException, ResourceNotResendableException, ForbiddenUserException, FailedRequestException
Writes the contents of a handle to the provided path on the REST server.
libraryDescriptor - The descriptory which locates where to install the library.contentHandle - The handle containing the contents of the library.ResourceNotFoundExceptionResourceNotResendableExceptionForbiddenUserExceptionFailedRequestExceptionvoid delete(String libraryPath) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Removes a library asset from the server.
libraryPath - The path to the library to delete.ResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid delete(ExtensionLibraryDescriptor libraryDescriptor) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Removes a library asset from the server.
libraryDescriptor - A descriptor locating the library to delete.ResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionCopyright © 2013-2017 MarkLogic Corporation.