本文整理汇总了Java中org.eclipse.jgit.lib.Constants.encode方法的典型用法代码示例。如果您正苦于以下问题:Java Constants.encode方法的具体用法?Java Constants.encode怎么用?Java Constants.encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.lib.Constants
的用法示例。
在下文中一共展示了Constants.encode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ExactPathFilter
import org.eclipse.jgit.lib.Constants; //导入方法依赖的package包/类
private ExactPathFilter (final PathFilter filter) {
pathStr = filter.getPath();
pathRaw = Constants.encode(pathStr);
this.filter = filter;
}
示例2: forceToRaw
import org.eclipse.jgit.lib.Constants; //导入方法依赖的package包/类
/**
* Encode a string pattern for faster matching on byte arrays.
* <p>
* Force the characters to our funny UTF-8 only convention that we use on
* raw buffers. This avoids needing to perform character set decodes on the
* individual commit buffers.
*
* @param patternText
* original pattern string supplied by the user or the
* application.
* @return same pattern, but re-encoded to match our funny raw UTF-8
* character sequence {@link RawCharSequence}.
*/
protected static final String forceToRaw(final String patternText) {
final byte[] b = Constants.encode(patternText);
final StringBuilder needle = new StringBuilder(b.length);
for (int i = 0; i < b.length; i++)
needle.append((char) (b[i] & 0xff));
return needle.toString();
}
示例3: FooterKey
import org.eclipse.jgit.lib.Constants; //导入方法依赖的package包/类
/**
* Create a key for a specific footer line.
*
* @param keyName
* name of the footer line.
*/
public FooterKey(final String keyName) {
name = keyName;
raw = Constants.encode(keyName.toLowerCase(Locale.ROOT));
}