From: Glenn H. <tur...@us...> - 2004-06-19 15:02:13
|
Update of /cvsroot/smartfrog/core/components/slp/src/org/smartfrog/services/comm/slp/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3441/src/org/smartfrog/services/comm/slp/util Modified Files: SLPUtil.java Log Message: - Prim/Reference/Object locators can now return a Vector containing all discovered services. - some clean-up and fixes... Index: SLPUtil.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/slp/src/org/smartfrog/services/comm/slp/util/SLPUtil.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SLPUtil.java 15 Jun 2004 13:01:34 -0000 1.1 --- SLPUtil.java 19 Jun 2004 15:02:04 -0000 1.2 *************** *** 101,104 **** --- 101,114 ---- /** + Converts a Vector to a String-list. + [1,2] => "1, 2" + */ + public static String vectorToString(Vector v) { + String s = v.toString(); + s = s.substring(1, s.length()-1); // remove [ and ] + return s; + } + + /** Extracts the attributes from the given String. @param attrString The string containing the attributes. *************** *** 141,153 **** /** ! Parses the given string and returns a Vector of scope names. ! @param scopeStr The String to parse. ! @return A Vector of the listed scope names. @exception ServiceLocationException if there is an error parsing the String. */ ! public static Vector parseScopes(String scopeStr) throws ServiceLocationException { Vector toReturn = new Vector(); ! if(!scopeStr.equals("")) { ! String s[] = scopeStr.split(","); for(int i=0; i<s.length; i++) { toReturn.add(s[i]); --- 151,162 ---- /** ! Converts a string-list into a Vector ! @param str The String to parse. @exception ServiceLocationException if there is an error parsing the String. */ ! public static Vector stringToVector(String str) throws ServiceLocationException { Vector toReturn = new Vector(); ! if(!str.equals("")) { ! String s[] = str.split(","); for(int i=0; i<s.length; i++) { toReturn.add(s[i]); |