Object pluginWWW = iPluginData.getParameter("www");
if (pluginWWW == null)
pluginWWW = iPluginData.getName();
final OServerNetworkListener httpListener = server.getListenerByProtocol(ONetworkProtocolHttpAbstract.class);
final OServerCommandGetStaticContent command = (OServerCommandGetStaticContent) httpListener
.getCommand(OServerCommandGetStaticContent.class);
if (command != null) {
final URL wwwURL = iPluginData.getClassLoader().findResource("www/");
final OCallable<Object, String> callback;
if (wwwURL != null)
callback = createStaticLinkCallback(iPluginData, wwwURL);
else
// LET TO THE COMMAND TO CONTROL IT
callback = new OCallable<Object, String>() {
@Override
public Object call(final String iArgument) {
return iPluginData.getInstance().getContent(iArgument);
}
};
command.registerVirtualFolder(pluginWWW.toString(), callback);
}
}