UUID uuid = UUID.Zero;
UUID creatorID = UUID.Zero;
UUID ownerID = UUID.Zero;
UUID lastOwnerID = UUID.Zero;
UUID groupID = UUID.Zero;
Permissions permissions = Permissions.NoPermissions;
int salePrice = 0;
SaleType saleType = SaleType.Not;
UUID parentUUID = UUID.Zero;
UUID assetUUID = UUID.Zero;
AssetType assetType = AssetType.Unknown;
InventoryType inventoryType = InventoryType.Unknown;
//uint
long flags = 0;
String name = "";
String description = "";
Date creationDate = Utils.Epoch;
while (true)
{
if(!(m = Pattern.compile("([^\\s]+)(\\s+)?(.*)?").matcher(lines[i++])).find())
throw new Exception("wrong format");
// if (!(m = Regex.Match(lines[i++], @"([^\s]+)(\s+)?(.*)?")).Success)
// throw new Exception("wrong format");
String key = m.group(1);
StringBuilder val = new StringBuilder(m.group(3));
if (key.equals("{"))
continue;
if (key.equals("}"))
break;
else if (key.equals("permissions"))
{
//uint
long baseMask = 0;
long ownerMask = 0;
long groupMask = 0;
long everyoneMask = 0;
long nextOwnerMask = 0;
while (true)
{
if(!(m = Pattern.compile("([^\\s]+)(\\s+)?([^\\s]+)?").matcher(lines[i++])).find())
throw new Exception("wrong format");
// if (!(m = Regex.Match(lines[i++], @"([^\s]+)(\s+)?([^\s]+)?")).Success)
// throw new Exception("wrong format");
String pkey = m.group(1);
String pval = m.group(3);
if (pkey.equals("{"))
continue;
if (pkey.equals("}"))
break;
else if (pkey.equals("creator_id"))
{
creatorID = new UUID(pval);
}
else if (pkey.equals("owner_id"))
{
ownerID = new UUID(pval);
}
else if (pkey.equals("last_owner_id"))
{
lastOwnerID = new UUID(pval);
}
else if (pkey.equals("group_id"))
{
groupID = new UUID(pval);
}
else if (pkey.equals("base_mask"))
{
baseMask = Utils.hexStringToUInt(pval, false);
// baseMask = Utils.hexStringToUInt(pval, false);
}
else if (pkey.equals("owner_mask"))
{
ownerMask = Utils.hexStringToUInt(pval, false);
}
else if (pkey.equals("group_mask"))
{
groupMask = Utils.hexStringToUInt(pval, false);
}
else if (pkey.equals("everyone_mask"))
{
everyoneMask = Utils.hexStringToUInt(pval, false);
}
else if (pkey.equals("next_owner_mask"))
{
nextOwnerMask = Utils.hexStringToUInt(pval, false);
}
}
permissions = new Permissions(baseMask, everyoneMask, groupMask, nextOwnerMask, ownerMask);
}
else if (key.equals("sale_info"))
{
while (true)
{