Skip to content

Instantly share code, notes, and snippets.

View jabocg's full-sized avatar
🐍
Python Is Dead, Long Live Python

Jacob Gersztyn jabocg

🐍
Python Is Dead, Long Live Python
  • Arizona
View GitHub Profile
// delete a volume
final SecureVolume vol;
final List<SecureVolume> volList;
volList = saife.listVolumes();
vol = volList.get(0);
saife.removeVolume(vol);
// 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 {
final String shareID = "some_text";
final String storagePath = "/some/path";
final PersistentStore persistentStore = new Persister();
final NetworkShare ns;
final Contact contact;
try {
// get the network share
ns = mgr.getNetworkShare(shareID, storagePath, persistentStore);
// This retrieve or creates a network share manager.
// these will varry with implementation
final String shareID = "some_text";
final String storagePath = "/some/path";
final PersistentStore persistentStore = new Persister();
final NetworkShare ns;
// create a manager
final NetworkShareManager mgr = new NetworkShareManager(saife);
SecureCommsGroup group;
List<String> groups = saife.ListGroups();
try {
group = saife.getGroup(groups.get(0));
} catch (final GroupNotFoundException gnfe) {
final String m = gnfe.getMessage();
System.out.println(m);
}
class MessageListener implements SecureCommsGroupListener {
public MessageListener() {
}
@Override
public void groupDestroyed(String groupID, String groupName) {
System.out.println("group was destroyed: " + groupName);
}
SecureCommsGroup group;
List<String> groups = saife.ListGroups();
String message = "some message";
try {
group = saife.getGroup(groups.get(0));
} catch (final GroupNotFoundException gnfe) {
final String m = gnfe.getMessage();
System.out.println(m);
}
SecureCommsGroup group;
List<String> groups = saife.ListGroups();
Contact contact;
try {
group = saife.getGroup(groups.get(0));
contact = saife.getContactsByName("client1").get(0);
} catch (final NoSuchContactException nsce) {
final String m = nsce.getMessage();
System.out.println(m);
SecureCommsGroup group;
List<String> groups = saife.ListGroups();
Contact contact;
try {
group = saife.getGroup(groups.get(0));
contact = saife.getContactsByName("client1").get(0);
} catch (final NoSuchContactException nsce) {
final String m = nsce.getMessage();
System.out.println(m);
SecureCommsGroup group;
List<String> groups = saife.ListGroups();
try {
group = saife.getGroup(groups.get(0));
} catch (final GroupNotFoundException gnfe) {
final String m = gnfe.getMessage();
System.out.println(m);
}