try
{
if (theHandle == null)
{
throw new HandleException(HandleException.INTERNAL_ERROR);
}
String handle = Util.decodeString(theHandle);
context = new Context();
String url = HandleManager.resolveToURL(context, handle);
if (url == null)
{
throw new HandleException(HandleException.HANDLE_DOES_NOT_EXIST);
}
HandleValue value = new HandleValue();
value.setIndex(100);
value.setType(Util.encodeString("URL"));
value.setData(Util.encodeString(url));
value.setTTLType((byte) 0);
value.setTTL(100);
value.setTimestamp(100);
value.setReferences(null);
value.setAdminCanRead(true);
value.setAdminCanWrite(false);
value.setAnyoneCanRead(true);
value.setAnyoneCanWrite(false);
List<HandleValue> values = new LinkedList<HandleValue>();
values.add(value);
byte[][] rawValues = new byte[values.size()][];
for (int i = 0; i < values.size(); i++)
{
HandleValue hvalue = values.get(i);
rawValues[i] = new byte[Encoder.calcStorageSize(hvalue)];
Encoder.encodeHandleValue(rawValues[i], 0, hvalue);
}
return rawValues;
}
catch (HandleException he)
{
throw he;
}
catch (Exception e)
{
if (log.isDebugEnabled())
{
log.debug("Exception in getRawHandleValues", e);
}
// Stack loss as exception does not support cause
throw new HandleException(HandleException.INTERNAL_ERROR);
}
finally
{
if (context != null)
{