Jian Li
Committed by Gerrit Code Review

[ONOS-3634] Provide default category name and make url nullable

Change-Id: Id6d0404cc1e46cdd4f54f2ff64ca69313bec9281
...@@ -75,7 +75,7 @@ public class DefaultApplicationDescription implements ApplicationDescription { ...@@ -75,7 +75,7 @@ public class DefaultApplicationDescription implements ApplicationDescription {
75 this.description = checkNotNull(description, "Description cannot be null"); 75 this.description = checkNotNull(description, "Description cannot be null");
76 this.origin = checkNotNull(origin, "Origin cannot be null"); 76 this.origin = checkNotNull(origin, "Origin cannot be null");
77 this.category = checkNotNull(category, "Category cannot be null"); 77 this.category = checkNotNull(category, "Category cannot be null");
78 - this.url = checkNotNull(url, "URL cannot be null"); 78 + this.url = url;
79 this.readme = checkNotNull(readme, "Readme cannot be null"); 79 this.readme = checkNotNull(readme, "Readme cannot be null");
80 this.icon = icon; 80 this.icon = icon;
81 this.role = checkNotNull(role, "Role cannot be null"); 81 this.role = checkNotNull(role, "Role cannot be null");
......
...@@ -74,7 +74,7 @@ public class DefaultApplication implements Application { ...@@ -74,7 +74,7 @@ public class DefaultApplication implements Application {
74 this.description = checkNotNull(description, "Description cannot be null"); 74 this.description = checkNotNull(description, "Description cannot be null");
75 this.origin = checkNotNull(origin, "Origin cannot be null"); 75 this.origin = checkNotNull(origin, "Origin cannot be null");
76 this.category = checkNotNull(category, "Category cannot be null"); 76 this.category = checkNotNull(category, "Category cannot be null");
77 - this.url = checkNotNull(url, "URL cannot be null"); 77 + this.url = url;
78 this.readme = checkNotNull(readme, "Readme cannot be null"); 78 this.readme = checkNotNull(readme, "Readme cannot be null");
79 this.icon = icon; 79 this.icon = icon;
80 this.role = checkNotNull(role, "Role cannot be null"); 80 this.role = checkNotNull(role, "Role cannot be null");
......
...@@ -86,6 +86,8 @@ public class ApplicationArchive ...@@ -86,6 +86,8 @@ public class ApplicationArchive
86 private static final String APPS = "[@apps]"; 86 private static final String APPS = "[@apps]";
87 private static final String DESCRIPTION = "description"; 87 private static final String DESCRIPTION = "description";
88 88
89 + private static final String UTILITY = "utility";
90 +
89 private static final String CATEGORY = "[@category]"; 91 private static final String CATEGORY = "[@category]";
90 private static final String URL = "[@url]"; 92 private static final String URL = "[@url]";
91 93
...@@ -293,7 +295,7 @@ public class ApplicationArchive ...@@ -293,7 +295,7 @@ public class ApplicationArchive
293 String name = cfg.getString(NAME); 295 String name = cfg.getString(NAME);
294 Version version = Version.version(cfg.getString(VERSION)); 296 Version version = Version.version(cfg.getString(VERSION));
295 String origin = cfg.getString(ORIGIN); 297 String origin = cfg.getString(ORIGIN);
296 - String category = cfg.getString(CATEGORY); 298 + String category = cfg.getString(CATEGORY, UTILITY);
297 String url = cfg.getString(URL); 299 String url = cfg.getString(URL);
298 byte[] icon = getApplicationIcon(name); 300 byte[] icon = getApplicationIcon(name);
299 ApplicationRole role = getRole(cfg.getString(ROLE)); 301 ApplicationRole role = getRole(cfg.getString(ROLE));
......