From 0c03a48fb2060eda4d288e2d2ca4e650ce000b4b Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Wed, 4 Feb 2009 00:01:36 +0000 Subject: - add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it - trim trailing whitespace --- OpenSim/Framework/AssetBase.cs | 95 ++++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 22 deletions(-) (limited to 'OpenSim/Framework/AssetBase.cs') diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index 48ef2ff..f9c9457 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs @@ -26,7 +26,9 @@ */ using System; +using System.Collections.Generic; using OpenMetaverse; +using OpenMetaverse.StructuredData; namespace OpenSim.Framework { @@ -34,69 +36,118 @@ namespace OpenSim.Framework public class AssetBase { private byte[] _data; - private string _description = String.Empty; - private UUID _fullid; - private bool _local = false; - private string _name = String.Empty; - private bool _temporary = false; - private sbyte _type; + private AssetMetadata _metadata; public AssetBase() { + Metadata = new AssetMetadata(); } public AssetBase(UUID assetId, string name) { - FullID = assetId; - Name = name; + Metadata = new AssetMetadata(); + Metadata.FullID = assetId; + Metadata.Name = name; + } + + public virtual byte[] Data + { + get { return _data; } + set { _data = value; } + } + + public virtual AssetMetadata Metadata + { + get { return _metadata; } + set { _metadata = value; } } + } + + [Serializable] + public class AssetMetadata + { + private UUID _fullid; + private string _name = String.Empty; + private string _description = String.Empty; + private DateTime _creation_date; + private sbyte _type; + private string _content_type; + private byte[] _sha1; + private bool _local = false; + private bool _temporary = false; + //private Dictionary _methods = new Dictionary(); + //private OSDMap _extra_data; - public virtual UUID FullID + public UUID FullID { get { return _fullid; } set { _fullid = value; } } - public virtual string ID + public string ID { get { return _fullid.ToString(); } set { _fullid = new UUID(value); } } - public virtual byte[] Data + public string Name { - get { return _data; } - set { _data = value; } + get { return _name; } + set { _name = value; } + } + + public string Description + { + get { return _description; } + set { _description = value; } + } + + public DateTime CreationDate + { + get { return _creation_date; } + set { _creation_date = value; } } - public virtual sbyte Type + public sbyte Type { get { return _type; } set { _type = value; } } - public virtual string Name + public string ContentType { - get { return _name; } - set { _name = value; } + get { return _content_type; } + set { _content_type = value; } } - public virtual string Description + public byte[] SHA1 { - get { return _description; } - set { _description = value; } + get { return _sha1; } + set { _sha1 = value; } } - public virtual bool Local + public bool Local { get { return _local; } set { _local = value; } } - public virtual bool Temporary + public bool Temporary { get { return _temporary; } set { _temporary = value; } } + + //public Dictionary Methods + //{ + // get { return _methods; } + // set { _methods = value; } + //} + + //public OSDMap ExtraData + //{ + // get { return _extra_data; } + // set { _extra_data = value; } + //} } } -- cgit v1.1