modified Upload on suggest words

This commit is contained in:
shatake 2014-10-31 14:30:05 +09:00
parent abf020ecb0
commit f86cd807f9
4 changed files with 4 additions and 10 deletions

View file

@ -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(

View file

@ -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(

View file

@ -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;
}

View file

@ -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;
}