当前位置: 首页>>代码示例>>Java>>正文


Java LintUtils.endsWith方法代码示例

本文整理汇总了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();
}
 
开发者ID:evant,项目名称:silent-support,代码行数:22,代码来源:ApiLookup.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ApiLookup.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:PrivateKeyDetector.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:StringFormatDetector.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:OverdrawDetector.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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:51,代码来源:TypoLookup.java


注:本文中的com.android.tools.lint.detector.api.LintUtils.endsWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。