{
throw new InvalidParameterException("RequestURI and InsertURI must be set together");
}
final WoTOwnIdentity id;
if (requestUriString != null) {
final FreenetURI requestUri = new FreenetURI(requestUriString); // throws Exception if malformed
final FreenetURI insertUri = new FreenetURI(insertUriString); // throws Exception if malformed
id = (WoTOwnIdentity)mFreetalk.getIdentityManager().createOwnIdentity(
nickName,
publishTrustList,
publishIntroductionPuzzles,
autoSubscribe,
displayImages,
requestUri,
insertUri);
} else {
id = (WoTOwnIdentity)mFreetalk.getIdentityManager().createOwnIdentity(
nickName,
publishTrustList,
publishIntroductionPuzzles,
autoSubscribe,
displayImages);
}
// id can't be null when we come here
final SimpleFieldSet sfs = new SimpleFieldSet(true);
sfs.putOverwrite("Message", "CreateOwnIdentityReply");
sfs.putOverwrite("OwnIdentityCreated", "true");
sfs.putOverwrite("ID", id.getID());
sfs.putOverwrite("FreetalkAddress", id.getFreetalkAddress());
sfs.putOverwrite("InsertURI", id.getInsertURI().toString());
sfs.putOverwrite("RequestURI", id.getRequestURI().toString());
replysender.send(sfs);
} catch(final Exception e) {
final SimpleFieldSet sfs = new SimpleFieldSet(true);
sfs.putOverwrite("Message", "CreateOwnIdentityReply");