Skip to content
Snippets Groups Projects
TestDatabaseConfig.java 699 B
Newer Older
package org.briarproject;
import org.briarproject.api.db.DatabaseConfig;

public class TestDatabaseConfig implements DatabaseConfig {

	private final File dir;
	private final long maxSize;
	private volatile byte[] key = new byte[] { 'f', 'o', 'o' };

	public TestDatabaseConfig(File dir, long maxSize) {
		this.dir = dir;
		this.maxSize = maxSize;
	}

	public boolean databaseExists() {
		return dir.isDirectory() && dir.listFiles().length > 0;
	}

	public File getDatabaseDirectory() {
	public void setEncryptionKey(byte[] key) {
		this.key = key;
	}

	public byte[] getEncryptionKey() {
		return key;