{ops4j-style-page}

{excerpt}
[Pax Coin File System Configuration Provider|Pax Coin - Provider - File System] will scan the content of [configurable directories|Pax Coin - Provider - File System#config] for configuration files and each found file (see supported file formats) will be considered as a configuration.
To see how you can use this provider take a look at the [example use case|Pax Coin - Provider - File System - Example].
{excerpt}

{include:Pax Coin - Resource Scanners}

{anchor:scanning}
h4. Scanning
File System Configuration Provider will poll the configured directory for changes. As soon as a change is encountered, the change will trigger an update on the configuration corresponding to the changed file as follow:
* new file available or file content is updated --- corresponding _ManagedService_ / _ManagedServiceFactory_ will be updated with the new configuration; a file is considered changed if is new or the last update time has changed;
* file is deleted --- corresponding _ManagedService_ / _ManagedServiceFactory_ configuration will be deleted.

{anchor:config}
h4. Configuration
File System Configuration Provider can be itself configured in two ways: via system properties and via Configuration Admin Service as _ManagedServiceFactory_. By default (not configured) the file system provider will not scan any directory.

h5. Configuration via system properties
The most trivial way to configure file system provider is via setting the following system properties:
* *{{org.ops4j.pax.coin.directory}}* --- the file path of the [ops4j:scanned directory|#scanning] containing configuration files.
* *{{org.ops4j.pax.coin.directory.poll.interval}}* --- the interval in milliseconds between scans of the specified directory. If not set the default scanning interval will be 1 minute.  

h5. Configuration via Configuration Admin Service 
A more powerful way to configure file system provider is by configuring it via Configuration Admin. The file system provider will register itself as a _ManagedServiceFactory_ with factory pid *{{org.ops4j.pax.coin.file.system}}* in order to be able to configure multiple directories to be scanned. Each configuration must contain the following properties:
* *{{directory}}* --- the file path of the [ops4j:scanned directory|#scanning] containing configuration files.
* *{{poll.interval}}* --- the interval in milliseconds between scans of the specified directory. If not set the default scanning interval will be 1 minute.