Skip to content

Instantly share code, notes, and snippets.

@jabocg
Created April 26, 2016 21:43
Show Gist options
  • Save jabocg/1c28ef69db64a82bd6715d3e4276f4d5 to your computer and use it in GitHub Desktop.
Save jabocg/1c28ef69db64a82bd6715d3e4276f4d5 to your computer and use it in GitHub Desktop.
// create a volume
final SecureVolume.VolumeType vt = SecureVolume.VolumeType.PERMANENT;
final String vFile = "/some/path/to/file";
final String volLabel = "some_label";
// must be multiple of 1024, at least 10MB
final long volSize = 1024 * 1024 * 10;
final SecureVolume vol;
try {
vol = saife.createVolume(vt, vFile, volLabel, volSize);
} catch (final ProfisioningRequredException pre) {
final String m = pre.getMessage();
System.out.println(m);
} catch (final UnlockRequiredException ure) {
final String m = ure.getMessage();
System.out.println(m);
} catch (final IllegalArgumentException iae) {
final String m = iae.getMessage();
System.out.println(m);
} catch (final IOException ioe) {
final String m = ioe.getMessage();
System.out.println(m);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment