Package org.alfresco.util.exec
Class ExecParameterTokenizer
- java.lang.Object
-
- org.alfresco.util.exec.ExecParameterTokenizer
-
public class ExecParameterTokenizer extends java.lang.Object
This class is used to tokenize strings used as parameters forRuntimeExec
objects. Examples of such strings are as follows (ImageMagick-like parameters):- -font Helvetica -pointsize 50
- -font Helvetica -pointsize 50 -draw "circle 100,100 150,150"
- -font Helvetica -pointsize 50 -draw "gravity south fill black text 0,12 'CopyRight'"
- Since:
- 3.4.2
- Author:
- Neil Mc Erlean
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ExecParameterTokenizer.QuotedSubstring
A substring that is surrounded by (single or double) quotes.static interface
ExecParameterTokenizer.Substring
Utility interface for a substring in a parameter string.class
ExecParameterTokenizer.UnquotedSubstring
A substring that is not surrounded by (single or double) quotes.
-
Constructor Summary
Constructors Constructor Description ExecParameterTokenizer(java.lang.String str)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getAllTokens()
This method returns the tokens in a parameter string.
-
-
-
Method Detail
-
getAllTokens
public java.util.List<java.lang.String> getAllTokens()
This method returns the tokens in a parameter string. Any tokens not contained within single or double quotes will be tokenized in the normal way i.e. by using whitespace separators and the standard StringTokenizer algorithm. Any tokens which are contained within single or double quotes will be returned as single String instances and will have their quote marks removed. See above for examples.- Throws:
java.lang.NullPointerException
- if the string to be tokenized was null.
-
-