Class DemoCorpus
java.lang.Object
ai.redouble.demo.DemoCorpus
Locates the shipped demo corpus, the folder the extract and decide runs read and the page
shows, wherever and on whatever OS the process runs. A checkout serves it straight from the
source tree; anywhere else the corpus rides the classpath (
src/main/resources/corpus
in the build) and is extracted once per process into a temporary directory, because the
extractor reads files on a disk, not resources. Either way the page shows a real absolute
path in this machine's own spelling - the server resolves it, so separators and roots are
never the page's guess. No request names a folder: a different one is read by changing
locate() here, in the engine both hosts share.
The extraction copies the files a manifest names (corpus.manifest, one relative path
per line) rather than walking the corpus classpath directory, because a native image
carries the files but cannot list the directory. Each file is read by its exact resource path,
which works the same from a build's output, a jar, or a native image. DemoCorpusTest
pins the manifest to the files actually shipped, so a corpus file added without a manifest line
fails the build rather than going missing at runtime.
- Since:
- 0.1 (2026-09-17)
- Author:
- Andrey Santrosyan
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe corpus as the directory a run reads.path()The corpus's absolute path: acorpusdirectory under the working directory when one exists (a person's own takes the shipped one's place), else the checkout'ssrc/main/resources/corpus, else the classpath copy extracted into a fresh temporary directory.
-
Field Details
-
AS_OF
The day the shipped corpus's price story is answered for: 1 June 2026, the day the last price the documents decide takes effect (the twenty percent rise the May minutes decided). On that day every list in the corpus is current or superseded and every later figure is a proposal, so the pricing steps open on it rather than on whatever day the demo runs; a day before it shows the rise as scheduled instead.- See Also:
-
-
Constructor Details
-
DemoCorpus
public DemoCorpus()
-
-
Method Details
-
path
The corpus's absolute path: acorpusdirectory under the working directory when one exists (a person's own takes the shipped one's place), else the checkout'ssrc/main/resources/corpus, else the classpath copy extracted into a fresh temporary directory. Null when the classpath carries no corpus, or when the extraction failed - this feeds a status surface, so the failure is logged in full and the page says there is no folder. -
directory
The corpus as the directory a run reads. A classpath that carries no corpus, or whose extraction failed, has nothing to read, and a run on it is a deployment's defect rather than a caller's: it throws instead of refusing.
-