ImportTaskRecordsMVCActionCommand.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:ch-inofix-timetracker 作者:
protected void validateFile(ActionRequest actionRequest, ActionResponse actionResponse, String folderName)
        throws Exception {

    _log.info("validateFile()");

    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

    long groupId = ParamUtil.getLong(actionRequest, "groupId");

    FileEntry fileEntry = ExportImportHelperUtil.getTempFileEntry(groupId, themeDisplay.getUserId(), folderName);

    InputStream inputStream = null;

    try {
        inputStream = _dlFileEntryLocalService.getFileAsStream(fileEntry.getFileEntryId(), fileEntry.getVersion(),
                false);

        // TODO: validate uploaded file

        JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
        //
        // if ((weakMissingReferences != null) &&
        // !weakMissingReferences.isEmpty()) {
        //
        // jsonObject.put("warningMessages",
        // StagingUtil.getWarningMessagesJSONArray(themeDisplay.getLocale(),
        // weakMissingReferences));
        // }

        JSONPortletResponseUtil.writeJSON(actionRequest, actionResponse, jsonObject);
    } finally {
        StreamUtil.cleanUp(inputStream);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号