modified Upload on suggest words
This commit is contained in:
parent
abf020ecb0
commit
f86cd807f9
4 changed files with 4 additions and 10 deletions
|
@ -277,7 +277,7 @@ public class SuggestBadWordAction extends BsSuggestBadWordAction {
|
|||
final File oFile = tempFile;
|
||||
try {
|
||||
final String head = new String(b, Constants.UTF_8);
|
||||
if (!head.startsWith("\"SuggestWord\",")) {
|
||||
if (!(head.startsWith("\"BadWord\"") || head.startsWith("BadWord"))) {
|
||||
log.error("Unknown file: "
|
||||
+ suggestBadWordForm.suggestBadWordFile);
|
||||
throw new SSCActionMessagesException(
|
||||
|
|
|
@ -276,7 +276,7 @@ public class SuggestElevateWordAction extends BsSuggestElevateWordAction {
|
|||
final File oFile = tempFile;
|
||||
try {
|
||||
final String head = new String(b, Constants.UTF_8);
|
||||
if (!head.startsWith("\"SuggestWord\",")) {
|
||||
if (!(head.startsWith("\"SuggestWord\"") || head.startsWith("SuggestWord"))) {
|
||||
log.error("Unknown file: "
|
||||
+ suggestElevateWordForm.suggestElevateWordFile);
|
||||
throw new SSCActionMessagesException(
|
||||
|
|
|
@ -178,16 +178,13 @@ public class SuggestBadWordService extends BsSuggestBadWordService implements
|
|||
}
|
||||
|
||||
private static String getValue(final List<String> list, final int index) {
|
||||
if (index < list.size()) {
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
String item = list.get(index).trim();
|
||||
if (StringUtil.isBlank(item)) {
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
if (item.length() > 1 && item.charAt(0) == '"'
|
||||
&& item.charAt(item.length() - 1) == '"') {
|
||||
item = item.substring(1, item.length() - 2);
|
||||
item = item.substring(1, item.length() - 1);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
|
|
@ -204,16 +204,13 @@ public class SuggestElevateWordService extends BsSuggestElevateWordService
|
|||
}
|
||||
|
||||
static String getValue(final List<String> list, final int index) {
|
||||
if (index < list.size()) {
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
String item = list.get(index).trim();
|
||||
if (StringUtil.isBlank(item)) {
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
if (item.length() > 1 && item.charAt(0) == '"'
|
||||
&& item.charAt(item.length() - 1) == '"') {
|
||||
item = item.substring(1, item.length() - 2);
|
||||
item = item.substring(1, item.length() - 1);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue