本文整理了Java中com.google.android.exoplayer2.util.Util.unescapeFileName()
方法的一些代码示例,展示了Util.unescapeFileName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.unescapeFileName()
方法的具体详情如下:
包路径:com.google.android.exoplayer2.util.Util
类名称:Util
方法名:unescapeFileName
[英]Unescapes an escaped file or directory name back to its original value.
See #escapeFileName(String) for more information.
[中]将转义的文件或目录名重新转换回其原始值。
有关更多信息,请参见#escapeFileName(字符串)。
代码示例来源:origin: google/ExoPlayer
Matcher matcher = CACHE_FILE_PATTERN_V2.matcher(filename);
if (matcher.matches()) {
key = Util.unescapeFileName(matcher.group(1));
if (key == null) {
return null;
代码示例来源:origin: google/ExoPlayer
@Test
public void testUnescapeInvalidFileName() {
assertThat(Util.unescapeFileName("%a")).isNull();
assertThat(Util.unescapeFileName("%xyz")).isNull();
}
代码示例来源:origin: google/ExoPlayer
private static void assertEscapeUnescapeFileName(String fileName) {
String escapedFileName = Util.escapeFileName(fileName);
assertThat(unescapeFileName(escapedFileName)).isEqualTo(fileName);
}
代码示例来源:origin: google/ExoPlayer
private static void assertEscapeUnescapeFileName(String fileName, String escapedFileName) {
assertThat(escapeFileName(fileName)).isEqualTo(escapedFileName);
assertThat(unescapeFileName(escapedFileName)).isEqualTo(fileName);
}
内容来源于网络,如有侵权,请联系作者删除!