mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Changed the root package from net.sf.briar to org.briarproject.
This commit is contained in:
37
briar-tests/src/org/briarproject/TestDatabaseConfig.java
Normal file
37
briar-tests/src/org/briarproject/TestDatabaseConfig.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package org.briarproject;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
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() {
|
||||
return dir;
|
||||
}
|
||||
|
||||
public void setEncryptionKey(byte[] key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public byte[] getEncryptionKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public long getMaxSize() {
|
||||
return maxSize;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user