diff options
author | Mike Mazur | 2009-02-04 00:01:36 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-04 00:01:36 +0000 |
commit | 0c03a48fb2060eda4d288e2d2ca4e650ce000b4b (patch) | |
tree | a90465075960c92367b0a5e62db3121e4e3a139d /OpenSim/Framework/AssetBase.cs | |
parent | * Add another object to the existing save oar test (diff) | |
download | opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.zip opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.gz opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.bz2 opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.xz |
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
Diffstat (limited to 'OpenSim/Framework/AssetBase.cs')
-rw-r--r-- | OpenSim/Framework/AssetBase.cs | 95 |
1 files changed, 73 insertions, 22 deletions
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 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | ||
29 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenMetaverse.StructuredData; | ||
30 | 32 | ||
31 | namespace OpenSim.Framework | 33 | namespace OpenSim.Framework |
32 | { | 34 | { |
@@ -34,69 +36,118 @@ namespace OpenSim.Framework | |||
34 | public class AssetBase | 36 | public class AssetBase |
35 | { | 37 | { |
36 | private byte[] _data; | 38 | private byte[] _data; |
37 | private string _description = String.Empty; | 39 | private AssetMetadata _metadata; |
38 | private UUID _fullid; | ||
39 | private bool _local = false; | ||
40 | private string _name = String.Empty; | ||
41 | private bool _temporary = false; | ||
42 | private sbyte _type; | ||
43 | 40 | ||
44 | public AssetBase() | 41 | public AssetBase() |
45 | { | 42 | { |
43 | Metadata = new AssetMetadata(); | ||
46 | } | 44 | } |
47 | 45 | ||
48 | public AssetBase(UUID assetId, string name) | 46 | public AssetBase(UUID assetId, string name) |
49 | { | 47 | { |
50 | FullID = assetId; | 48 | Metadata = new AssetMetadata(); |
51 | Name = name; | 49 | Metadata.FullID = assetId; |
50 | Metadata.Name = name; | ||
51 | } | ||
52 | |||
53 | public virtual byte[] Data | ||
54 | { | ||
55 | get { return _data; } | ||
56 | set { _data = value; } | ||
57 | } | ||
58 | |||
59 | public virtual AssetMetadata Metadata | ||
60 | { | ||
61 | get { return _metadata; } | ||
62 | set { _metadata = value; } | ||
52 | } | 63 | } |
64 | } | ||
65 | |||
66 | [Serializable] | ||
67 | public class AssetMetadata | ||
68 | { | ||
69 | private UUID _fullid; | ||
70 | private string _name = String.Empty; | ||
71 | private string _description = String.Empty; | ||
72 | private DateTime _creation_date; | ||
73 | private sbyte _type; | ||
74 | private string _content_type; | ||
75 | private byte[] _sha1; | ||
76 | private bool _local = false; | ||
77 | private bool _temporary = false; | ||
78 | //private Dictionary<string, Uri> _methods = new Dictionary<string, Uri>(); | ||
79 | //private OSDMap _extra_data; | ||
53 | 80 | ||
54 | public virtual UUID FullID | 81 | public UUID FullID |
55 | { | 82 | { |
56 | get { return _fullid; } | 83 | get { return _fullid; } |
57 | set { _fullid = value; } | 84 | set { _fullid = value; } |
58 | } | 85 | } |
59 | 86 | ||
60 | public virtual string ID | 87 | public string ID |
61 | { | 88 | { |
62 | get { return _fullid.ToString(); } | 89 | get { return _fullid.ToString(); } |
63 | set { _fullid = new UUID(value); } | 90 | set { _fullid = new UUID(value); } |
64 | } | 91 | } |
65 | 92 | ||
66 | public virtual byte[] Data | 93 | public string Name |
67 | { | 94 | { |
68 | get { return _data; } | 95 | get { return _name; } |
69 | set { _data = value; } | 96 | set { _name = value; } |
97 | } | ||
98 | |||
99 | public string Description | ||
100 | { | ||
101 | get { return _description; } | ||
102 | set { _description = value; } | ||
103 | } | ||
104 | |||
105 | public DateTime CreationDate | ||
106 | { | ||
107 | get { return _creation_date; } | ||
108 | set { _creation_date = value; } | ||
70 | } | 109 | } |
71 | 110 | ||
72 | public virtual sbyte Type | 111 | public sbyte Type |
73 | { | 112 | { |
74 | get { return _type; } | 113 | get { return _type; } |
75 | set { _type = value; } | 114 | set { _type = value; } |
76 | } | 115 | } |
77 | 116 | ||
78 | public virtual string Name | 117 | public string ContentType |
79 | { | 118 | { |
80 | get { return _name; } | 119 | get { return _content_type; } |
81 | set { _name = value; } | 120 | set { _content_type = value; } |
82 | } | 121 | } |
83 | 122 | ||
84 | public virtual string Description | 123 | public byte[] SHA1 |
85 | { | 124 | { |
86 | get { return _description; } | 125 | get { return _sha1; } |
87 | set { _description = value; } | 126 | set { _sha1 = value; } |
88 | } | 127 | } |
89 | 128 | ||
90 | public virtual bool Local | 129 | public bool Local |
91 | { | 130 | { |
92 | get { return _local; } | 131 | get { return _local; } |
93 | set { _local = value; } | 132 | set { _local = value; } |
94 | } | 133 | } |
95 | 134 | ||
96 | public virtual bool Temporary | 135 | public bool Temporary |
97 | { | 136 | { |
98 | get { return _temporary; } | 137 | get { return _temporary; } |
99 | set { _temporary = value; } | 138 | set { _temporary = value; } |
100 | } | 139 | } |
140 | |||
141 | //public Dictionary<string, Uri> Methods | ||
142 | //{ | ||
143 | // get { return _methods; } | ||
144 | // set { _methods = value; } | ||
145 | //} | ||
146 | |||
147 | //public OSDMap ExtraData | ||
148 | //{ | ||
149 | // get { return _extra_data; } | ||
150 | // set { _extra_data = value; } | ||
151 | //} | ||
101 | } | 152 | } |
102 | } | 153 | } |