Package org.eclipse.jgit.util
Class QuotedString.GitPathStyle
- java.lang.Object
-
- org.eclipse.jgit.util.QuotedString
-
- org.eclipse.jgit.util.QuotedString.GitPathStyle
-
- Enclosing class:
- QuotedString
public static final class QuotedString.GitPathStyle extends QuotedString
Quoting style that obeys the rules Git applies to file names
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jgit.util.QuotedString
QuotedString.BourneStyle, QuotedString.BourneUserPathStyle, QuotedString.GitPathStyle
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
quote
private boolean
quoteHigh
-
Fields inherited from class org.eclipse.jgit.util.QuotedString
BOURNE, BOURNE_USER_PATH, GIT_PATH, GIT_PATH_MINIMAL
-
-
Constructor Summary
Constructors Modifier Constructor Description private
GitPathStyle(boolean doQuote)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
dequote(byte[] in, int inPtr, int inEnd)
Decode a previously quoted input, scanning a UTF-8 encoded buffer.private static java.lang.String
dq(byte[] in, int inPtr, int inEnd)
java.lang.String
quote(java.lang.String instr)
Quote an input string by the quoting rules.-
Methods inherited from class org.eclipse.jgit.util.QuotedString
dequote
-
-
-
-
Method Detail
-
quote
public java.lang.String quote(java.lang.String instr)
Description copied from class:QuotedString
Quote an input string by the quoting rules.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.
- Specified by:
quote
in classQuotedString
- Parameters:
instr
- any non-null Unicode string.- Returns:
- a quoted string. See above for details.
-
dequote
public java.lang.String dequote(byte[] in, int inPtr, int inEnd)
Description copied from class:QuotedString
Decode a previously quoted input, scanning a UTF-8 encoded buffer.This method must match quote such that:
a.equals(dequote(Constants.encode(quote(a))));
is true for anya
.This method removes any opening/closing quotation marks added by
QuotedString.quote(String)
.- Specified by:
dequote
in classQuotedString
- Parameters:
in
- the input buffer to parse.inPtr
- first position withinin
to scan.inEnd
- one position past inin
to scan.- Returns:
- the cleaned string.
-
dq
private static java.lang.String dq(byte[] in, int inPtr, int inEnd)
-
-