本文整理汇总了Java中com.helger.commons.string.StringHelper.endsWith方法的典型用法代码示例。如果您正苦于以下问题:Java StringHelper.endsWith方法的具体用法?Java StringHelper.endsWith怎么用?Java StringHelper.endsWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.helger.commons.string.StringHelper
的用法示例。
在下文中一共展示了StringHelper.endsWith方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCleanConcatenatedUrlPath
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
/**
* Concatenate a base URL and a sub path incl. the path cleansing. More or
* less the same as calling <code>getCleanPath (sURL + "/" + sPath)</code>
*
* @param sURL
* The base URL. May not be <code>null</code>.
* @param sPath
* The path to append. May not be <code>null</code>.
* @return The combined, cleaned path.
* @see #getCleanPath(String)
*/
@Nonnull
public static String getCleanConcatenatedUrlPath (@Nonnull final String sURL, @Nonnull final String sPath)
{
ValueEnforcer.notNull (sURL, "URL");
ValueEnforcer.notNull (sPath, "Path");
// If nothing is to be appended, just clean the base URL
if (StringHelper.hasNoText (sPath))
return getCleanPath (sURL);
final String sRealURL = StringHelper.endsWith (sURL, UNIX_SEPARATOR) ? sURL : sURL + UNIX_SEPARATOR;
final String sRealPath = StringHelper.startsWith (sPath, UNIX_SEPARATOR) ? sPath.substring (1) : sPath;
return getCleanPath (sRealURL + sRealPath);
}
示例2: isCSSFilename
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
/**
* Check if the passed filename is a CSS filename (independent if regular or
* minified)
*
* @param sFilename
* The filename to check.
* @return <code>true</code> if the passed filename is a CSS filename.
*/
public static boolean isCSSFilename (@Nullable final String sFilename)
{
return StringHelper.endsWith (sFilename, CCSS.FILE_EXTENSION_CSS);
}
示例3: isMinifiedCSSFilename
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
/**
* Check if the passed filename is a minified CSS filename
*
* @param sFilename
* The filename to check.
* @return <code>true</code> if the passed filename is a minified CSS
* filename.
*/
public static boolean isMinifiedCSSFilename (@Nullable final String sFilename)
{
return StringHelper.endsWith (sFilename, CCSS.FILE_EXTENSION_MIN_CSS);
}