...
directoryPath
- base directory for all files shared with the repositoryprojections -
lists one or more mappings from the repository to the filesystem. The format is "{workspace}:{repository path} => {filesystem path relative todirectoryPath
}". See Multiple Directories below for how to handle multiple mappings.contentBasedSha1 -
controls how internal identifiers are computed for files. By default (contentBaseSha1
= true), Modeshape computes the SHA-1 checksum of a file's content every time the file is accessed. For small files this creates a modest overhead. For large files, however, this dramatically reduces performance, since generating the checksum can take several seconds per gigabyte of data. For this reason, we recommend settingcontentBasedSha1
to false when serving files larger than 100MBreadonly -
controls whether the contents of the filesbase directory for all files shared with the repository are read-onlyextraPropertiesStorage
- sets the format for storing "extra" properties (properties that can't be set using filesystem attributes). Recommended values are "json" for the current JSON properties format, or "none" for disabling extra properties
Modeshape's FileSystemConnector documentation and configuration provide additional information about configuring the filesystem connector.
Multiple Directories
Although the syntax appears to support multiple mappings, we have found that a separate configuration block is required for each directory to be federatedIf you want to map multiple directories, the first entry in the projections array should map the parent directory (i.e, the directory in directoryPath
). Subsequent entries can map subdirectories to other repository paths. For example, if you have a directory /pub/
that contains two directories (/pub/project1/
and /pub/project2/
) which you want to map the project1
and project2
directories to the top level of the repository:
Code Block |
---|
"externalSources" : { "federated-1" : { "classname" : "org.fcrepo.connector.file.FedoraFileSystemConnector", "directoryPath" : "/path/to/dir1pub", "projections" : [ "default:/dir1pub => /" ], "contentBasedSha1" default: "false", "readonly" : true, "extraPropertiesStorage" : "none" }, "federated-2" : { "classname" : "org.fcrepo.connector.file.FedoraFileSystemConnector", "directoryPath" : "/path/to/dir2", "projections" : [ "default:/dir2/project1 => /project1", "default:/probject2 => /project2" ], "contentBasedSha1" : "false", "readonly" : true, "extraPropertiesStorage" : "none" } } |
This configuration would provide access to the two directories at the following mappings:
Repository URL | Filesystem Path |
---|---|
http://localhost:8080/rest/pub/ | /pub/ |
http://localhost:8080/rest |
...
/project1/ | /pub/project1/ |
http://localhost:8080/rest |
...
/project2/ | /pub/project2/ |
Other Connectors
In addition to the filesystem connector, Modeshape includes several other connectors, for federating content from Git, CMIS repositories, and relational databases.
...