jsonWriter.startObject().addFieldName("userLibs").startArray();
ILibraryManager libMan = ServerManager.getServerManager().getLibraryManager();
for (int i = 0; i < installedLibs.length; i++) {
String id = installedLibs[i].getId();
String version = installedLibs[i].getVersion();
Library lib = libMan.getLibrary(id, version);
/* if library doesn't exist continue */
if (lib == null) {
continue;
}
jsonWriter.startObject().addField("id", id);
jsonWriter.addField("version", version);
jsonWriter.addField("metaRoot", lib.getMetadataPath());
String required = installedLibs[i].getRequired();
jsonWriter.addField("required", required!=null && (Boolean.parseBoolean(required)?true:false));
jsonWriter.addField("hasSource", lib.getSourcePath()!=null);
if( installedLibs[i].getVirtualRoot()!=null)
jsonWriter.addField("root", installedLibs[i].getVirtualRoot());
jsonWriter.endObject();
}