The Sandbox

Acorus allows you to designate a sandbox: a directory to which the application writes assets and other files. This directory is traditionally named "Written Assets".

An Acorus sandbox is merely a convention, not a security feature; Acorus won’t inhibit an application from modifying or deleting files outside its sandbox.

If a sandbox is desired, it must be designated prior to initialization — in main(), typically. For example:

try {
    ActionApplication.designateSandbox("./Written Assets");
} catch (IOException exception) {
    // handle the exception
}

HelloSandbox

HelloCombo is an example application that modifies HelloAcorus by designating a sandbox.

When the user triggers the "ScreenShot" action, the captured image is written to "./Written Assets" instead of the working directory.

HelloRecorder

ActionApplication implements a "toggle recorder" action to control jMonkeyEngine’s VideoRecorderAppState.

HelloRecorder is an example application that modifies HelloSandbox by binding F3 to the "toggle recorder" action.

  • Initially, pressing F3 starts the recorder and begins capturing video.

  • Pressing F3 again stops the recorder and writes the captured video to "./Written Assets".

Summary

  • You can designate a sandbox for writing assets and other files.

  • This must be done prior to initialization.

  • If a sandbox is designated, screenshots and video recordings will be written there.