List of usage examples for com.liferay.portal.kernel.util UnicodeFormatter UNICODE_PREFIX
String UNICODE_PREFIX
To view the source code for com.liferay.portal.kernel.util UnicodeFormatter UNICODE_PREFIX.
Click Source Link
From source file:com.liferay.document.library.internal.util.DLValidatorImpl.java
License:Open Source License
@Override public boolean isValidName(String name) { if (Validator.isNull(name)) { return false; }//from w w w. j a v a2 s .c o m for (String blacklistChar : PropsValues.DL_CHAR_BLACKLIST) { if (name.contains(blacklistChar)) { return false; } } for (String blacklistLastChar : PropsValues.DL_CHAR_LAST_BLACKLIST) { if (blacklistLastChar.startsWith(UnicodeFormatter.UNICODE_PREFIX)) { blacklistLastChar = UnicodeFormatter.parseString(blacklistLastChar); } if (name.endsWith(blacklistLastChar)) { return false; } } String nameWithoutExtension = FileUtil.stripExtension(name); for (String blacklistName : PropsValues.DL_NAME_BLACKLIST) { if (StringUtil.equalsIgnoreCase(nameWithoutExtension, blacklistName)) { return false; } } return true; }
From source file:com.liferay.document.library.internal.util.DLValidatorImpl.java
License:Open Source License
protected String replaceDLCharLastBlacklist(String title) { String previousTitle = null;/*from www . j a v a 2 s.co m*/ while (!title.equals(previousTitle)) { previousTitle = title; for (String blacklistLastChar : PropsValues.DL_CHAR_LAST_BLACKLIST) { if (blacklistLastChar.startsWith(UnicodeFormatter.UNICODE_PREFIX)) { blacklistLastChar = UnicodeFormatter.parseString(blacklistLastChar); } if (title.endsWith(blacklistLastChar)) { title = StringUtil.replaceLast(title, blacklistLastChar, StringPool.BLANK); } } } return title; }