Configuration configuration,
Configuration.RslPathInfo info,
Set<String> unusedRsls,
StringBuilder buf) {
List<String>rslUrls = info.getRslUrls();
RuntimeSharedLibrarySettingsConfiguration rslSettingsConfig =
configuration.getRuntimeSharedLibrarySettingsConfiguration();
for (int i = 0; i < rslUrls.size(); i++)
{
// start new object
buf.append("new RSLData(");
String url = rslUrls.get(i);
buf.append("\"" + url + "\",\n");
// write policy url
buf.append("\"" +
info.getPolicyFileUrls().get(i) +
"\",\n");
// get the swc for current rsl
String swcPath = info.getSwcVirtualFile().getName();
Swc swc = swcContext.getSwc(swcPath);
// write digest for each rsl in the list
boolean secureRsls = configuration.getVerifyDigests();
Boolean isSigned = (Boolean)info.getSignedFlags().get(i);
Digest digest = swc.getDigest(Swc.LIBRARY_SWF,
Digest.SHA_256,
isSigned.booleanValue());
if (digest == null || !digest.hasDigest())
{
// if the digest is not available then throw an exception,
// "No digest found in catalog.xml. Either compile the application with
// the -verify-digests=false or compile the library with
// -create-digest=true"
if (isSigned.booleanValue()) {
ThreadLocalToolkit.log(new MissingSignedLibraryDigest(swc.getLocation()));
}
else {
ThreadLocalToolkit.log(new MissingUnsignedLibraryDigest(swc.getLocation()));
}
return;
}
buf.append("\"" + digest.getValue() + "\",\n");
buf.append("\"" + digest.getType() + "\",");
buf.append(info.getSignedFlags().get(i) + ",");
buf.append(secureRsls + ",");
buf.append("\"" + rslSettingsConfig.getApplicationDomain(swcPath) + "\"");
// end of one object in the array
buf.append(")");
if (i + 1 < rslUrls.size())