From 5dde719988ad570ce610853db9993540b6bb9ee7 Mon Sep 17 00:00:00 2001 From: alena Date: Mon, 10 Jan 2011 14:53:07 -0800 Subject: [PATCH] Api xmlDocWriter: write each xml command to single file for 1)rootAdmin 2)domainAdmin 3)regularUser --- .../com/cloud/api/doc/ApiXmlDocWriter.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java index 06e488133c6..712835f127d 100644 --- a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java +++ b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java @@ -145,7 +145,6 @@ public class ApiXmlDocWriter { //Write commands in the order they are represented in commands.properties.in file Iterator it = all_api_commands.keySet().iterator(); while (it.hasNext()) { - ObjectOutputStream singleCommandOs = null; String key = (String)it.next(); //Write admin commands @@ -153,26 +152,29 @@ public class ApiXmlDocWriter { writeCommand(rootAdmin, key); //Write single commands to separate xml files - singleCommandOs = xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "/" + key + ".xml"), "command"); + ObjectOutputStream singleRootAdminCommandOs = xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "/" + key + ".xml"), "command"); + writeCommand(singleRootAdminCommandOs, key); + singleRootAdminCommandOs.close(); if (domain_admin_api_commands.containsKey(key)){ writeCommand(domainAdmin, key); - singleCommandOs = xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "/" + key + ".xml"), "command"); + ObjectOutputStream singleDomainAdminCommandOs = xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "/" + key + ".xml"), "command"); + writeCommand(singleDomainAdminCommandOs, key); + singleDomainAdminCommandOs.close(); } if (regular_user_api_commands.containsKey(key)){ - singleCommandOs = xs.createObjectOutputStream(new FileWriter(regularUserDirName + "/" + key + ".xml"), "command"); writeCommand(regularUser, key); - } - writeCommand(singleCommandOs, key); - singleCommandOs.close(); + ObjectOutputStream singleRegularUserCommandOs = xs.createObjectOutputStream(new FileWriter(regularUserDirName + "/" + key + ".xml"), "command"); + writeCommand(singleRegularUserCommandOs, key); + singleRegularUserCommandOs.close(); + } } //Write sorted commands it = all_api_commands_sorted.keySet().iterator(); while (it.hasNext()) { String key = (String)it.next(); - writeCommand(rootAdminSorted, key); @@ -215,7 +217,6 @@ public class ApiXmlDocWriter { Command apiCommand = new Command(); apiCommand.setName(command); - Implementation impl = (Implementation)clas.getAnnotation(Implementation.class); if (impl == null) impl = (Implementation)clas.getSuperclass().getAnnotation(Implementation.class);