diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/AssetBase.cs | 144 |
1 files changed, 91 insertions, 53 deletions
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index dfe559e..f3dd70a 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs | |||
@@ -33,128 +33,166 @@ namespace OpenSim.Framework | |||
33 | [Serializable] | 33 | [Serializable] |
34 | public class AssetBase | 34 | public class AssetBase |
35 | { | 35 | { |
36 | private byte[] _data; | 36 | private byte[] m_data; |
37 | private AssetMetadata _metadata; | 37 | private AssetMetadata m_metadata; |
38 | 38 | ||
39 | public AssetBase() | 39 | public AssetBase() |
40 | { | 40 | { |
41 | Metadata = new AssetMetadata(); | 41 | m_metadata = new AssetMetadata(); |
42 | } | 42 | } |
43 | 43 | ||
44 | public AssetBase(UUID assetId, string name) | 44 | public AssetBase(UUID assetId, string name) |
45 | { | 45 | { |
46 | Metadata = new AssetMetadata(); | 46 | m_metadata = new AssetMetadata(); |
47 | Metadata.FullID = assetId; | 47 | m_metadata.FullID = assetId; |
48 | Metadata.Name = name; | 48 | m_metadata.Name = name; |
49 | } | 49 | } |
50 | 50 | ||
51 | public virtual byte[] Data | 51 | public virtual byte[] Data |
52 | { | 52 | { |
53 | get { return _data; } | 53 | get { return m_data; } |
54 | set { _data = value; } | 54 | set { m_data = value; } |
55 | } | 55 | } |
56 | 56 | ||
57 | public virtual AssetMetadata Metadata | 57 | public UUID FullID |
58 | { | 58 | { |
59 | get { return _metadata; } | 59 | get { return m_metadata.FullID; } |
60 | set { _metadata = value; } | 60 | set { m_metadata.FullID = value; } |
61 | } | 61 | } |
62 | 62 | ||
63 | // We expose FullID here because the NHibernate mappers require a | 63 | public string ID |
64 | // property on the AssetBase class for its primary key (see | 64 | { |
65 | // OpenSim/Data/NHibernate/Resources/AssetBase.hbm.xml). | 65 | get { return m_metadata.ID; } |
66 | public UUID FullID | 66 | set { m_metadata.ID = value; } |
67 | } | ||
68 | |||
69 | public string Name | ||
70 | { | ||
71 | get { return m_metadata.Name; } | ||
72 | set { m_metadata.Name = value; } | ||
73 | } | ||
74 | |||
75 | public string Description | ||
76 | { | ||
77 | get { return m_metadata.Description; } | ||
78 | set { m_metadata.Description = value; } | ||
79 | } | ||
80 | |||
81 | public sbyte Type | ||
67 | { | 82 | { |
68 | get { return Metadata.FullID; } | 83 | get { return m_metadata.Type; } |
69 | set { Metadata.FullID = value; } | 84 | set { m_metadata.Type = value; } |
85 | } | ||
86 | |||
87 | public bool Local | ||
88 | { | ||
89 | get { return m_metadata.Local; } | ||
90 | set { m_metadata.Local = value; } | ||
91 | } | ||
92 | |||
93 | public bool Temporary | ||
94 | { | ||
95 | get { return m_metadata.Temporary; } | ||
96 | set { m_metadata.Temporary = value; } | ||
97 | } | ||
98 | |||
99 | // We have methods here because properties are serialized, and we don't | ||
100 | // want that. | ||
101 | public virtual AssetMetadata getMetadata() | ||
102 | { | ||
103 | return m_metadata; | ||
104 | } | ||
105 | |||
106 | public virtual void setMetadata(AssetMetadata metadata) | ||
107 | { | ||
108 | m_metadata = metadata; | ||
70 | } | 109 | } |
71 | } | 110 | } |
72 | 111 | ||
73 | [Serializable] | ||
74 | public class AssetMetadata | 112 | public class AssetMetadata |
75 | { | 113 | { |
76 | private UUID _fullid; | 114 | private UUID m_fullid; |
77 | private string _name = String.Empty; | 115 | private string m_name = String.Empty; |
78 | private string _description = String.Empty; | 116 | private string m_description = String.Empty; |
79 | private DateTime _creation_date; | 117 | private DateTime m_creation_date; |
80 | private sbyte _type; | 118 | private sbyte m_type; |
81 | private string _content_type; | 119 | private string m_content_type; |
82 | private byte[] _sha1; | 120 | private byte[] m_sha1; |
83 | private bool _local = false; | 121 | private bool m_local = false; |
84 | private bool _temporary = false; | 122 | private bool m_temporary = false; |
85 | //private Dictionary<string, Uri> _methods = new Dictionary<string, Uri>(); | 123 | //private Dictionary<string, Uri> m_methods = new Dictionary<string, Uri>(); |
86 | //private OSDMap _extra_data; | 124 | //private OSDMap m_extra_data; |
87 | 125 | ||
88 | public UUID FullID | 126 | public UUID FullID |
89 | { | 127 | { |
90 | get { return _fullid; } | 128 | get { return m_fullid; } |
91 | set { _fullid = value; } | 129 | set { m_fullid = value; } |
92 | } | 130 | } |
93 | 131 | ||
94 | public string ID | 132 | public string ID |
95 | { | 133 | { |
96 | get { return _fullid.ToString(); } | 134 | get { return m_fullid.ToString(); } |
97 | set { _fullid = new UUID(value); } | 135 | set { m_fullid = new UUID(value); } |
98 | } | 136 | } |
99 | 137 | ||
100 | public string Name | 138 | public string Name |
101 | { | 139 | { |
102 | get { return _name; } | 140 | get { return m_name; } |
103 | set { _name = value; } | 141 | set { m_name = value; } |
104 | } | 142 | } |
105 | 143 | ||
106 | public string Description | 144 | public string Description |
107 | { | 145 | { |
108 | get { return _description; } | 146 | get { return m_description; } |
109 | set { _description = value; } | 147 | set { m_description = value; } |
110 | } | 148 | } |
111 | 149 | ||
112 | public DateTime CreationDate | 150 | public DateTime CreationDate |
113 | { | 151 | { |
114 | get { return _creation_date; } | 152 | get { return m_creation_date; } |
115 | set { _creation_date = value; } | 153 | set { m_creation_date = value; } |
116 | } | 154 | } |
117 | 155 | ||
118 | public sbyte Type | 156 | public sbyte Type |
119 | { | 157 | { |
120 | get { return _type; } | 158 | get { return m_type; } |
121 | set { _type = value; } | 159 | set { m_type = value; } |
122 | } | 160 | } |
123 | 161 | ||
124 | public string ContentType | 162 | public string ContentType |
125 | { | 163 | { |
126 | get { return _content_type; } | 164 | get { return m_content_type; } |
127 | set { _content_type = value; } | 165 | set { m_content_type = value; } |
128 | } | 166 | } |
129 | 167 | ||
130 | public byte[] SHA1 | 168 | public byte[] SHA1 |
131 | { | 169 | { |
132 | get { return _sha1; } | 170 | get { return m_sha1; } |
133 | set { _sha1 = value; } | 171 | set { m_sha1 = value; } |
134 | } | 172 | } |
135 | 173 | ||
136 | public bool Local | 174 | public bool Local |
137 | { | 175 | { |
138 | get { return _local; } | 176 | get { return m_local; } |
139 | set { _local = value; } | 177 | set { m_local = value; } |
140 | } | 178 | } |
141 | 179 | ||
142 | public bool Temporary | 180 | public bool Temporary |
143 | { | 181 | { |
144 | get { return _temporary; } | 182 | get { return m_temporary; } |
145 | set { _temporary = value; } | 183 | set { m_temporary = value; } |
146 | } | 184 | } |
147 | 185 | ||
148 | //public Dictionary<string, Uri> Methods | 186 | //public Dictionary<string, Uri> Methods |
149 | //{ | 187 | //{ |
150 | // get { return _methods; } | 188 | // get { return m_methods; } |
151 | // set { _methods = value; } | 189 | // set { m_methods = value; } |
152 | //} | 190 | //} |
153 | 191 | ||
154 | //public OSDMap ExtraData | 192 | //public OSDMap ExtraData |
155 | //{ | 193 | //{ |
156 | // get { return _extra_data; } | 194 | // get { return m_extra_data; } |
157 | // set { _extra_data = value; } | 195 | // set { m_extra_data = value; } |
158 | //} | 196 | //} |
159 | } | 197 | } |
160 | } | 198 | } |