Package edu.uiuc.ncsa.security.util.cli
Class CommandLineTokenizer
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.cli.CommandLineTokenizer
-
- All Implemented Interfaces:
Serializable
public final class CommandLineTokenizer extends Object implements Serializable
This is a very specific tokenizer for command lines from the Dumb gridFTP client. It pulls off the elements that are double-quote delimited (to allow for embedded blanks) and then tokenizes by spaces. The first word is assumed to be a command word and is translated to lower case. The others are not. This is intended to be instantiated once and reused. It preserves no state between calls.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected char
quoteDelimiter
-
Constructor Summary
Constructors Constructor Description CommandLineTokenizer()
CommandLineTokenizer(char quoteDelimiter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description char
getQuoteDelimiter()
static void
main(String[] args)
void
setQuoteDelimiter(char quoteDelimiter)
Vector
tokenize(String cl)
tokenize with whatever the current quote delimiter is.Vector
tokenize(String cl, char quoteDelimiter)
Vector
tokenize(String cl, String quoteDelimiter)
-
-
-
Method Detail
-
getQuoteDelimiter
public char getQuoteDelimiter()
-
setQuoteDelimiter
public void setQuoteDelimiter(char quoteDelimiter)
-
main
public static void main(String[] args)
-
tokenize
public Vector tokenize(String cl) throws MalformedCommandException
tokenize with whatever the current quote delimiter is. Default is double quotes.- Parameters:
cl
-- Returns:
- Throws:
MalformedCommandException
-
tokenize
public Vector tokenize(String cl, String quoteDelimiter) throws MalformedCommandException
- Throws:
MalformedCommandException
-
tokenize
public Vector tokenize(String cl, char quoteDelimiter) throws MalformedCommandException
- Throws:
MalformedCommandException
-
-