You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by kr...@apache.org on 2026/08/14 03:17:21 UTC

(opennlp) 03/16: model: Document archived-resource installation with a mirror-tested example

This is an automated email from the ASF dual-hosted git repository.

krickert pushed a commit to branch OPENNLP-1909-resource-installer
in repository https://gitbox.apache.org/repos/asf/opennlp.git

commit 871c53e4cf8ce28003645994d3f5e91c0e39a710
Author: Kristian Rickert <kr...@gmail.com>
AuthorDate: Mon Jul 20 04:43:42 2026 -0400

    model: Document archived-resource installation with a mirror-tested example
    
    Add a resource installer section to the model-loading manual citing ResourceInstallerTest.
---
 opennlp-docs/src/docbkx/model-loading.xml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/opennlp-docs/src/docbkx/model-loading.xml b/opennlp-docs/src/docbkx/model-loading.xml
index eb2356a80..5df9058a3 100644
--- a/opennlp-docs/src/docbkx/model-loading.xml
+++ b/opennlp-docs/src/docbkx/model-loading.xml
@@ -164,4 +164,22 @@ for(ClassPathModelEntry entry : models) {
 
     </para>
   </section>
+
+	<section xml:id="tools.model.resource-installer">
+		<title>Installing archived resources</title>
+		<para>
+			<code>ResourceInstaller</code> downloads or copies a resource URI into a
+			target directory, verifies an optional SHA-256 digest, and unpacks
+			<code>tar.gz</code>, <code>tgz</code>, zip, or plain gzip payloads while
+			rejecting path-traversal entries. The end-to-end flow packages a small
+			corpus, installs it through the public API, and leaves only the archived
+			files on disk. <code>ResourceInstallerTest</code> asserts the behavior
+			shown here.
+			<programlisting language="java"><![CDATA[
+Path result = ResourceInstaller.install(
+    corpusTarGz.toUri(), targetDirectory, expectedSha256);
+// result equals targetDirectory; corpus files unpack with their archive paths]]>
+			</programlisting>
+		</para>
+	</section>
 </chapter>
\ No newline at end of file