Revision 3377 trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/utils/Utilities.java

View differences:

Utilities.java
45 45
import java.io.OutputStream;
46 46

  
47 47
import java.rmi.NoSuchObjectException;
48
import java.util.StringTokenizer;
48 49
import java.util.Vector;
49 50

  
50 51

  
......
255 256
      }
256 257
      return true;
257 258
    }   
259
	/**
260
	 * Parses the String containing different items [character] separated and
261
	 * creates a vector with them.
262
	 * @param str String contains item1[c]item2[c]item3...
263
	 * @param c is the string value for separating the items
264
	 * @return Vector containing all the items
265
	 */
266
	public static Vector createVector(String str, String c)
267
	{
268
		StringTokenizer tokens = new StringTokenizer(str, c);
269
		Vector v = new Vector();
270
		try
271
		{
272
			while (tokens.hasMoreTokens())
273
			{
274
				v.addElement(tokens.nextToken());
275
			}
276
			return v;
277
		}
278
		catch (Exception e)
279
		{
280
			return new Vector();
281
		}
282
	}
283
   
258 284
}

Also available in: Unified diff