Click or drag to resize
DigitalRuneStorage Class
Implements base functionality for storage providers.
Inheritance Hierarchy

Namespace: DigitalRune.Storages
Assembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax
public abstract class Storage : IStorage, 
	IDisposable

The Storage type exposes the following members.

Constructors
  NameDescription
Protected methodStorage
Initializes a new instance of the Storage class
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by an instance of the Storage class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the Storage class and optionally releases the managed resources.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetRealPath
Gets the real path and name of the specified file.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpenFile
Opens the specified file for reading.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Protected propertyDirectorySeparator
Gets the directory separator character used natively by this storage.
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed of.
Top
Remarks
Important note Important

DigitalRune.Storages currently only provides read access to files! Full read/write access, as well as support for additional platforms, will be added in a future version.

The IStorage interface provides a common API to access files from different sources. The following implementations provide access to physical file systems on different platforms:

  • FileSystemStorage - provides access to the file system of the operating system.
  • TitleStorage - provides access to title storage on Xbox 360.
  • (Not yet implemented) UserStorage - provides access to user storage on Xbox 360.
  • (Not yet implemented) IsolatedStorage - provides access to isolated storage in Silverlight.
  • (Not yet implemented) WindowsStorage - provides access to storage folders in Windows Store apps.

Some storages are built on top of other storages. For example:

  • VfsStorage - maps existing storages into a virtual file system. Different storage devices and locations can be treated as one directory hierarchy.
  • ZipStorage - provides access to files stored in a ZIP archive. The ZIP archive can be read from any of the existing storages.

Case-Sensitivity:
File retrieval is case-sensitive if the storage provider (e.g. the platform OS) is case-sensitive. It is recommended to assume case-sensitivity to ensure that applications can be ported to non-Windows platforms.

Directory Separator:
Storages accepts '\' and '/' as directory separators. Internally, paths are normalized to use '/'.

Possible Extensions:
The IStorage concept is highly extensible. Developers can provide custom IStorage implementations to add support for new platforms or manipulate existing storages. Here are just a few features that could be implemented on top of IStorage:

  • Access control - A storage may wrap another storage and implement access control to restrict user access or filter certain files. For example, a "ReadOnlyStorage" may prevent write access to an existing location.
  • Archives - Storages can be added to support other package formats, such as 7-Zip, BZIP2, PAK.
  • Caching ("CachedStorage") - Files from another storage could be cached in memory for faster access.
  • Cloud storage - A storage may access data in the cloud, such as OneDrive.
  • Encryption ("EncryptedStorage") - Data could be encrypted and decrypted when accessing files in an existing storage.
  • Mapping ("RedirectStorage") - Directories can transparently be mapped to different location.
  • Redundancy ("MirroredStorage") - File access could be mirrored across different storages.
  • Ad-hoc storage - Instead of accessing files on an existing devices or locations, files can be stored in custom data structures (DBs, BLOBs, ...).
See Also