public static class QuotedString.BourneStyle extends QuotedString
Quotes are unconditionally inserted during quote(String)
. This
protects shell meta-characters like $
or ~
from
being recognized as special.
QuotedString.BourneStyle, QuotedString.BourneUserPathStyle, QuotedString.GitPathStyle
BOURNE, BOURNE_USER_PATH, GIT_PATH, GIT_PATH_MINIMAL
Constructor and Description |
---|
BourneStyle() |
Modifier and Type | Method and Description |
---|---|
String |
dequote(byte[] in,
int ip,
int ie)
Decode a previously quoted input, scanning a UTF-8 encoded buffer.
|
String |
quote(String in)
Quote an input string by the quoting rules.
|
dequote
public String quote(String in)
QuotedString
If the input string does not require any quoting, the same String reference is returned to the caller.
Otherwise a quoted string is returned, including the opening and closing quotation marks at the start and end of the string. If the style does not permit raw Unicode characters then the string will first be encoded in UTF-8, with unprintable sequences possibly escaped by the rules.
quote
in class QuotedString
in
- any non-null Unicode string.public String dequote(byte[] in, int ip, int ie)
QuotedString
This method must match quote such that:
a.equals(dequote(Constants.encode(quote(a))));is true for any
a
.
This method removes any opening/closing quotation marks added by
QuotedString.quote(String)
.
dequote
in class QuotedString
in
- the input buffer to parse.ip
- first position within in
to scan.ie
- one position past in in
to scan.Copyright © 2019 Eclipse JGit Project. All rights reserved.