The File Store Configuration.

This is almost deprecated, since it has performance issues for all but small stores. Yo should probably consider using a Derby store in file mode instead. If you have a large existing file store and need to change to a Derby store, use the migration tool.

Scope: client and server, all versions.

A file store will persist items in a local file system. It requires either

  • A single directory under which any required directories will be created, or
  • two directories, a data directory and an index directory
In both cases the system will manage these in the sense that they will be created as needed along with any needed subdirectories.
path Single top-level directory. Any required subdirectories will be made under this one.

The next set of attributes is per file store, so they would be, e.g., in the tag for the specific store.

removeEmptyFiles Remove any empty files in the store. The default is true meaning that empty files will be deleted if found in the file store.
removeFailedFiles Remove any files in the store that cannot be loaded/understood by the system. The default is false meaning that bad files will be kept if found in the file store. Set true only if the file store alone manages its directory!

You must specify the path. The effect will be to create (and manage) directories for each store.

A file-based store system is a great, easy way to set up your storage. It require nothing more than the correct permissions. Remember though that you should do the usual administrative tasks of backing it up as needed and protecting it from prying eyes since it will contain sensitive information. Both clients and servers support file stores.

Server examples

Example 1.

<service name="default" address="https://myservice.org:8443/oauth">
   <fileStore path="/var/www/storage">
      <transactions/>
      <clients removeFailedFiles="true"/>
      <clientApprovals/>
   </fileStore>
</service>

This sets up a fully functioning service with local storage and using the default MyProxy service. This would create the following:

  • /var/www/storage/transactions/dataPath
  • /var/www/storage/transactions/indexPath
  • /var/www/storage/clients/dataPath
  • /var/www/storage/clients/indexPath
  • /var/www/storage/clientApprovals/dataPath
  • /var/www/storage/clientApprovals/indexPath

A client example

Using a file store in a client

A client file store can be applied to
<config>
   <client name="my-cfg">
        <fileStore path="/var/www/client/storage"
                 removeEmptyFiles="false">
          <assetStore>
        </fileStore>
        <!-- other stuff -->
</config>
This makes the asset store in the given directory. This will not remove empty files in the archive when it finds them.