Search in sources :

Example 1 with BasedFileSystem

use of org.apache.jackrabbit.core.fs.BasedFileSystem in project jackrabbit by apache.

the class ObjectPersistenceManager method init.

//---------------------------------------------------< PersistenceManager >
/**
     * {@inheritDoc}
     */
public void init(PMContext context) throws Exception {
    if (initialized) {
        throw new IllegalStateException("already initialized");
    }
    FileSystem wspFS = context.getFileSystem();
    itemStateFS = new BasedFileSystem(wspFS, "/data");
    /**
         * store BLOB data in local file system in a sub directory
         * of the workspace home directory
         */
    LocalFileSystem blobFS = new LocalFileSystem();
    blobFS.setRoot(new File(context.getHomeDir(), "blobs"));
    blobFS.init();
    this.blobFS = blobFS;
    blobStore = new FileSystemBLOBStore(blobFS);
    initialized = true;
}
Also used : BasedFileSystem(org.apache.jackrabbit.core.fs.BasedFileSystem) LocalFileSystem(org.apache.jackrabbit.core.fs.local.LocalFileSystem) LocalFileSystem(org.apache.jackrabbit.core.fs.local.LocalFileSystem) BasedFileSystem(org.apache.jackrabbit.core.fs.BasedFileSystem) FileSystem(org.apache.jackrabbit.core.fs.FileSystem) File(java.io.File) FileSystemBLOBStore(org.apache.jackrabbit.core.persistence.util.FileSystemBLOBStore)

Example 2 with BasedFileSystem

use of org.apache.jackrabbit.core.fs.BasedFileSystem in project jackrabbit by apache.

the class BundleFsPersistenceManager method init.

/**
     * {@inheritDoc}
     */
public void init(PMContext context) throws Exception {
    if (initialized) {
        throw new IllegalStateException("already initialized");
    }
    super.init(context);
    this.name = context.getHomeDir().getName();
    // create item fs
    itemFs = new BasedFileSystem(context.getFileSystem(), "items");
    // create correct blob store
    if (useLocalFsBlobStore()) {
        LocalFileSystem blobFS = new LocalFileSystem();
        blobFS.setRoot(new File(context.getHomeDir(), "blobs"));
        blobFS.init();
        blobStore = new BundleFsPersistenceManager.FSBlobStore(blobFS);
    } else {
        blobStore = new BundleFsPersistenceManager.FSBlobStore(itemFs);
    }
    // load namespaces
    binding = new BundleBinding(errorHandling, blobStore, getNsIndex(), getNameIndex(), context.getDataStore());
    binding.setMinBlobSize(minBlobSize);
    initialized = true;
}
Also used : BasedFileSystem(org.apache.jackrabbit.core.fs.BasedFileSystem) LocalFileSystem(org.apache.jackrabbit.core.fs.local.LocalFileSystem) BundleBinding(org.apache.jackrabbit.core.persistence.util.BundleBinding) File(java.io.File)

Example 3 with BasedFileSystem

use of org.apache.jackrabbit.core.fs.BasedFileSystem in project jackrabbit by apache.

the class XMLPersistenceManager method init.

//---------------------------------------------------< PersistenceManager >
/**
     * {@inheritDoc}
     */
public void init(PMContext context) throws Exception {
    if (initialized) {
        throw new IllegalStateException("already initialized");
    }
    itemStateFS = new BasedFileSystem(context.getFileSystem(), "/data");
    /**
         * store BLOB data in local file system in a sub directory
         * of the workspace home directory
         */
    LocalFileSystem blobFS = new LocalFileSystem();
    blobFS.setRoot(new File(context.getHomeDir(), "blobs"));
    blobFS.init();
    this.blobFS = blobFS;
    blobStore = new FileSystemBLOBStore(blobFS);
    initialized = true;
}
Also used : BasedFileSystem(org.apache.jackrabbit.core.fs.BasedFileSystem) LocalFileSystem(org.apache.jackrabbit.core.fs.local.LocalFileSystem) File(java.io.File) FileSystemBLOBStore(org.apache.jackrabbit.core.persistence.util.FileSystemBLOBStore)

Aggregations

File (java.io.File)3 BasedFileSystem (org.apache.jackrabbit.core.fs.BasedFileSystem)3 LocalFileSystem (org.apache.jackrabbit.core.fs.local.LocalFileSystem)3 FileSystemBLOBStore (org.apache.jackrabbit.core.persistence.util.FileSystemBLOBStore)2 FileSystem (org.apache.jackrabbit.core.fs.FileSystem)1 BundleBinding (org.apache.jackrabbit.core.persistence.util.BundleBinding)1