List of usage examples for com.mongodb MongoClientURI getURI
public String getURI()
From source file:org.netbeans.modules.mongodb.ui.components.MongoURIEditorPanel.java
License:Open Source License
private List<Option> decodeOptions(MongoClientURI uri) { final List<Option> options = new ArrayList<>(); final String uriString = uri.getURI(); final int index = uriString.indexOf('?'); if (index != -1) { final String optionsPart = uriString.substring(index + 1); for (String option : optionsPart.split("&|;")) { int idx = option.indexOf("="); if (idx >= 0) { final String key = option.substring(0, idx); final String value = option.substring(idx + 1); options.add(new Option(key, value)); }//from w ww . ja v a 2 s . c om } } return options; }