Java Code Examples for info.guardianproject.iocipher.File#delete()

The following examples show how to use info.guardianproject.iocipher.File#delete() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IOCipherOmemoStore.java    From Zom-Android-XMPP with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void removeAllRawSessionsOf(OmemoManager omemoManager, BareJid contact) {
    File contactsDirectory = hierarchy.getContactsDir(omemoManager, contact);
    String[] devices = contactsDirectory.list();

    for (String deviceId : devices != null ? devices : new String[0]) {
        int id;
        try {
            id = Integer.parseInt(deviceId);
        } catch (NumberFormatException e) {
            continue;
        }
        OmemoDevice device = new OmemoDevice(contact, id);
        File session = hierarchy.getContactsSessionPath(omemoManager, device);
        session.delete();
    }
}
 
Example 2
Source File: IOCipherOmemoStore.java    From Zom-Android-XMPP with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void removeOmemoPreKey(OmemoManager omemoManager, int preKeyId) {
    File preKeyPath = hierarchy.getPreKeyPath(omemoManager, preKeyId);
    preKeyPath.delete();
}
 
Example 3
Source File: IOCipherOmemoStore.java    From Zom-Android-XMPP with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void removeOmemoSignedPreKey(OmemoManager omemoManager, int signedPreKeyId) {
    File signedPreKeyPath = new File(hierarchy.getSignedPreKeysDirectory(omemoManager), Integer.toString(signedPreKeyId));
    signedPreKeyPath.delete();
}
 
Example 4
Source File: IOCipherOmemoStore.java    From Zom-Android-XMPP with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void removeRawSession(OmemoManager omemoManager, OmemoDevice device) {
    File sessionPath = hierarchy.getContactsSessionPath(omemoManager, device);
    sessionPath.delete();
}