use of org.apache.jackrabbit.core.fs.mem.MemoryFileSystem in project jackrabbit by apache.
the class RetentionRegistryImplTest method createFileSystem.
private FileSystem createFileSystem() {
FileSystem fs = new MemoryFileSystem();
BufferedWriter writer = null;
try {
fs.createFolder("/");
FileSystemResource file = new FileSystemResource(fs, "/retention");
writer = new BufferedWriter(new OutputStreamWriter(file.getOutputStream()));
writer.write(((NodeImpl) childN).getNodeId().toString());
} catch (FileSystemException e) {
log.error(e.getMessage());
} catch (IOException e) {
log.error(e.getMessage());
} finally {
IOUtils.closeQuietly(writer);
}
return fs;
}
use of org.apache.jackrabbit.core.fs.mem.MemoryFileSystem in project jackrabbit by apache.
the class PersistenceManagerTest method assertPersistenceManager.
private void assertPersistenceManager(PersistenceManager manager) throws Exception {
manager.init(new PMContext(directory, new MemoryFileSystem(), RepositoryImpl.ROOT_NODE_ID, new NamespaceRegistryImpl(new MemoryFileSystem()), null, null, new RepositoryStatisticsImpl()));
try {
assertCreateNewNode(manager);
assertCreateNewProperty(manager);
assertMissingItemStates(manager);
assertCreateUpdateDelete(manager);
} finally {
manager.close();
}
}
use of org.apache.jackrabbit.core.fs.mem.MemoryFileSystem in project jackrabbit by apache.
the class InMemPersistenceManager method init.
//---------------------------------------------------< PersistenceManager >
/**
* {@inheritDoc}
*/
public void init(PMContext context) throws Exception {
if (initialized) {
throw new IllegalStateException("already initialized");
}
stateStore = new HashMap<ItemId, byte[]>(initialCapacity, loadFactor);
refsStore = new HashMap<NodeId, byte[]>(initialCapacity, loadFactor);
wspFS = context.getFileSystem();
// Choose a FileSystem for the BlobStore based on whether data is persistent or not
if (persistent) {
blobFS = new LocalFileSystem();
((LocalFileSystem) blobFS).setRoot(new File(context.getHomeDir(), "blobs"));
} else {
blobFS = new MemoryFileSystem();
}
blobFS.init();
blobStore = new FileSystemBLOBStore(blobFS);
if (persistent) {
// deserialize contents of state and refs stores
loadContents();
}
initialized = true;
}
Aggregations