public Class findClass(String name) throws ClassNotFoundException {
Context context = new SystemContext();
try {
URI rendererUri = new URIValue(uri.toString() + name.replace('.', '/') + ".class");
StreamableValue resource = ((StreamableValue)Projector.getRepository().getResource(rendererUri, context.getCredentials()));
if ( resource == null ) {
throw new ClassNotFoundException("Class " + name + " at URI '"+rendererUri+"' not found in collection '" + uri + "'!");
}
InputStream inputStream = resource.getInputStream();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(1024);
StreamHelper.copy(inputStream, outputStream);
byte[] b = outputStream.toByteArray();
return defineClass(name, b, 0, b.length);
} catch (IOException e) {