# Storage Files and Directories

{% hint style="warning" %}
**This is the manual for older MicroStream versions (Version < 5.0).**

**The new documentation (Version >= 5.0) is located at:**

[https://docs.microstream.one/](https://docs.microstream.one/manual)
{% endhint %}

Using a Storage Live File Provider (`one.microstream.storage.types.StorageLiveFileProvider`) allows to specify the location and naming rules for all storage related files.

available properties are:

* **BaseDirectory** \
  The Microstream storages location base directory. Contains channel directories and type dictionary file.<br>
* **DeletionDirectory**\
  If configured, the storage will not delete files. Instead of deleting a file it will be moved to this directory.<br>
* **TruncationDirectory**\
  If configured, files that will get truncated are copied into this directory. <br>
* **ChannelDirectoryPrefix**\
  Channel directory prefix string<br>
* **StorageFilePrefix** \
  Storage file prefix string<br>
* **StorageFileSuffix**\
  storage file extension<br>
* **TransactionsFilePrefix**\
  transactions file prefix<br>
* **TransactionsFileSuffix**\
  transaction file extension<br>
* **TypeDictionaryFileName**\
  filename of the type dictionary

```java
StorageFileNameProvider fileNameProvider = StorageFileNameProvider.Builder()
	.setChannelDirectoryPrefix("canal_")
	.setDataFilePrefix        ("canal_")
	.setDataFileSuffix        (".bin")
	.setTransactionsFilePrefix("events_")
	.setTransactionsFileSuffix(".bin")
	.setTypeDictionaryFileName("typeDictionary.txt")
	.createFileNameProvider   ()
;

NioFileSystem           fileSystem   = NioFileSystem.New();
StorageLiveFileProvider fileProvider = Storage
	.FileProviderBuilder   (fileSystem)
	.setDirectory          (fileSystem.ensureDirectoryPath(WORKINGDIR))
	.setDeletionDirectory  (fileSystem.ensureDirectoryPath(DELETIONDIR))
	.setTruncationDirectory(fileSystem.ensureDirectoryPath(TRUNCATIONDIR))
	.setFileNameProvider   (fileNameProvider)
	.createFileProvider    ()
;
```
