本文整理汇总了Java中com.android.tools.lint.detector.api.LintUtils.endsWith方法的典型用法代码示例。如果您正苦于以下问题:Java LintUtils.endsWith方法的具体用法?Java LintUtils.endsWith怎么用?Java LintUtils.endsWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.tools.lint.detector.api.LintUtils
的用法示例。
在下文中一共展示了LintUtils.endsWith方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCacheFileName
import com.android.tools.lint.detector.api.LintUtils; //导入方法依赖的package包/类
@VisibleForTesting
@NonNull
static String getCacheFileName(@NonNull String xmlFileName, @Nullable String platformVersion) {
if (LintUtils.endsWith(xmlFileName, DOT_XML)) {
xmlFileName = xmlFileName.substring(0, xmlFileName.length() - DOT_XML.length());
}
StringBuilder sb = new StringBuilder(100);
sb.append(xmlFileName);
// Incorporate version number in the filename to avoid upgrade filename
// conflicts on Windows (such as issue #26663)
sb.append('-').append(BINARY_FORMAT_VERSION);
if (platformVersion != null) {
sb.append('-').append(platformVersion);
}
sb.append(".bin");
return sb.toString();
}
示例2: getCacheFileName
import com.android.tools.lint.detector.api.LintUtils; //导入方法依赖的package包/类
@VisibleForTesting
@NonNull
static String getCacheFileName(@NonNull String xmlFileName, @Nullable String platformVersion) {
if (LintUtils.endsWith(xmlFileName, DOT_XML)) {
xmlFileName = xmlFileName.substring(0, xmlFileName.length() - DOT_XML.length());
}
StringBuilder sb = new StringBuilder(100);
sb.append(xmlFileName);
// Incorporate version number in the filename to avoid upgrade filename
// conflicts on Windows (such as issue #26663)
sb.append('-').append(BINARY_FORMAT_VERSION);
if (platformVersion != null) {
sb.append('-').append(platformVersion);
}
sb.append(".bin"); //$NON-NLS-1$
return sb.toString();
}
示例3: isPrivateKeyFile
import com.android.tools.lint.detector.api.LintUtils; //导入方法依赖的package包/类
private static boolean isPrivateKeyFile(File file) {
if (!file.isFile() ||
(!LintUtils.endsWith(file.getPath(), "pem") && //NON-NLS-1$
!LintUtils.endsWith(file.getPath(), "key"))) { //NON-NLS-1$
return false;
}
try {
String firstLine = Files.readFirstLine(file, Charsets.US_ASCII);
return firstLine != null &&
firstLine.startsWith("---") && //NON-NLS-1$
firstLine.contains("PRIVATE KEY"); //NON-NLS-1$
} catch (IOException ex) {
// Don't care
}
return false;
}
示例4: appliesTo
import com.android.tools.lint.detector.api.LintUtils; //导入方法依赖的package包/类
@Override
public boolean appliesTo(@NonNull Context context, @NonNull File file) {
if (LintUtils.endsWith(file.getName(), DOT_JAVA)) {
return mFormatStrings != null;
}
return super.appliesTo(context, file);
}
示例5: appliesTo
import com.android.tools.lint.detector.api.LintUtils; //导入方法依赖的package包/类
@Override
public boolean appliesTo(@NonNull Context context, @NonNull File file) {
return LintUtils.isXmlFile(file) || LintUtils.endsWith(file.getName(), DOT_JAVA);
}
示例6: get
import com.android.tools.lint.detector.api.LintUtils; //导入方法依赖的package包/类
/**
* Returns an instance of the typo database
*
* @param client the client to associate with this database - used only for
* logging
* @param xmlFile the XML file containing configuration data to use for this
* database
* @return a (possibly shared) instance of the typo database, or null
* if its data can't be found
*/
@Nullable
private static TypoLookup get(LintClient client, File xmlFile) {
if (!xmlFile.exists()) {
client.log(null, "The typo database file %1$s does not exist", xmlFile);
return null;
}
String name = xmlFile.getName();
if (LintUtils.endsWith(name, DOT_XML)) {
name = name.substring(0, name.length() - DOT_XML.length());
}
File cacheDir = client.getCacheDir(true/*create*/);
if (cacheDir == null) {
cacheDir = xmlFile.getParentFile();
}
File binaryData = new File(cacheDir, name
// Incorporate version number in the filename to avoid upgrade filename
// conflicts on Windows (such as issue #26663)
+ '-' + BINARY_FORMAT_VERSION + ".bin"); //$NON-NLS-1$
if (DEBUG_FORCE_REGENERATE_BINARY) {
System.err.println("\nTemporarily regenerating binary data unconditionally \nfrom "
+ xmlFile + "\nto " + binaryData);
if (!createCache(client, xmlFile, binaryData)) {
return null;
}
} else if (!binaryData.exists() || binaryData.lastModified() < xmlFile.lastModified()) {
if (!createCache(client, xmlFile, binaryData)) {
return null;
}
}
if (!binaryData.exists()) {
client.log(null, "The typo database file %1$s does not exist", binaryData);
return null;
}
return new TypoLookup(client, xmlFile, binaryData);
}