rhtyd commented on a change in pull request #2293: CLOUDSTACK-10047: DVSwitch fixes and improvements URL: https://github.com/apache/cloudstack/pull/2293#discussion_r144197672
########## File path: utils/src/main/java/com/cloud/utils/UriUtils.java ########## @@ -391,4 +391,57 @@ public static InputStream getInputStreamFromUrl(String url, String user, String return null; } } + + /** + * Expands a given vlan URI to a list of vlan IDs + * @param vlanAuthority the URI part without the vlan:// scheme + * @return returns list of vlan integer ids + */ + public static List<Integer> expandVlanUri(final String vlanAuthority) { + final List<Integer> expandedVlans = new ArrayList<>(); + if (vlanAuthority == null || vlanAuthority.isEmpty()) { + return expandedVlans; + } + for (final String vlanPart: vlanAuthority.split(",")) { + if (vlanPart == null || vlanPart.isEmpty()) { Review comment: Fixed with `Strings.isNullOrEmpty`, thanks ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services