code refactoring
This commit is contained in:
parent
35d7189630
commit
7c03aae79d
3 changed files with 5 additions and 4 deletions
|
@ -64,8 +64,6 @@ public class Constants extends CoreLibConstants {
|
|||
|
||||
public static final String ITEM_NAME = "name";
|
||||
|
||||
public static final String UTF_8 = "UTF-8";
|
||||
|
||||
public static final String MS932 = "MS932";
|
||||
|
||||
public static final String DEFAULT_CRON_EXPRESSION = "0 0 * * *";
|
||||
|
|
|
@ -129,7 +129,7 @@ public class GsaApiManager extends BaseApiManager implements WebApiManager {
|
|||
final String start = request.getParameter("start");
|
||||
long startNumber = 1;
|
||||
if (StringUtil.isNotBlank(start)) {
|
||||
startNumber = Integer.parseInt(start) + 1;
|
||||
startNumber = Long.parseLong(start) + 1;
|
||||
}
|
||||
long endNumber = startNumber + data.getPageSize() - 1;
|
||||
if (endNumber > allRecordCount) {
|
||||
|
|
|
@ -150,9 +150,11 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
uploadFile = ResourceUtil.getResourceAsFileNoException(fileName);
|
||||
if (uploadFile == null) {
|
||||
throwValidationError(messages -> messages.addErrorsDesignFileNameIsNotFound("designFileName"), () -> asListHtml());
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
throwValidationError(messages -> messages.addErrorsDesignFileIsUnsupportedType("designFileName"), () -> asListHtml());
|
||||
return null;
|
||||
}
|
||||
|
||||
final File parentFile = uploadFile.getParentFile();
|
||||
|
@ -189,6 +191,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
final File file = getTargetFile(form.fileName).get();
|
||||
if (file == null) {
|
||||
throwValidationError(messages -> messages.addErrorsTargetFileDoesNotExist(GLOBAL, form.fileName), () -> asListHtml());
|
||||
return null;
|
||||
}
|
||||
validate(form, messages -> {}, () -> asListHtml());
|
||||
verifyToken(() -> asListHtml());
|
||||
|
@ -294,7 +297,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
throwValidationError(messages -> messages.addErrorsInvalidDesignJspFileName(GLOBAL), () -> asListHtml());
|
||||
}
|
||||
final File jspFile = new File(getServletContext().getRealPath("/WEB-INF/" + jspType + "/" + jspFileName));
|
||||
if (jspFile == null || !jspFile.exists()) {
|
||||
if (!jspFile.exists()) {
|
||||
throwValidationError(messages -> messages.addErrorsDesignJspFileDoesNotExist(GLOBAL), () -> asListHtml());
|
||||
}
|
||||
return jspFile;
|
||||
|
|
Loading…
Add table
Reference in a new issue