/// <summary>
        /// Parse space type.
        /// </summary>
        /// <param name="name">Name of the media type.</param>
        /// <returns><see cref="SparkMediaType"/> for the name.</returns>
        public static SparkMediaType Parse(string name)
        {
            SparkMediaType mediaType = null;

            if (!MEDIA_TYPES.TryGetValue(name, out mediaType))
            {
                mediaType = new SparkMediaType(name);
            }

            return(mediaType);
        }
        /// <summary>
        /// Determines whether this instance and another specified <see cref="SparkMediaType"/> object have the same value.
        /// </summary>
        /// <param name="value">The media type to compare to this instance.</param>
        /// <returns>true if the value of the parameter is the same as the value of this instance; otherwise, false. If value is null, the method returns false.</returns>
        public bool Equals(SparkMediaType value)
        {
            if (Object.ReferenceEquals(value, null))
            {
                return(false);
            }

            if (Object.ReferenceEquals(this, value))
            {
                return(true);
            }

            return(this.Name == value.Name);
        }
 /// <summary>
 /// Instanciate the file data.
 /// </summary>
 /// <param name="stream">Stream of the file.</param>
 /// <param name="fileName">File name of the file.</param>
 /// <param name="mediaType"><see cref="SparkMediaType"/> of the file.</param>
 public SparkFileData(Stream stream, string fileName, SparkMediaType mediaType)
 {
     this.Stream        = stream;
     this.FileName      = fileName;
     this.MediaTypeName = mediaType.Name;
 }