
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
package froala.editor.utils.view;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.view.AbstractView;
import egovframework.rte.fdl.cmmn.exception.EgovBizException;
import froala.editor.video.StreamingUtil;
/**
* 동영상 View
* @since 2021. 6. 18.
* @author 임종호
* <PRE>
* -----------------------
* 개정이력
* 2021. 6. 18. 임종호 : 최초작성
* </PRE>
*/
@Component
public class VideoView extends AbstractView {
private final static Logger LOGGER = LoggerFactory.getLogger(VideoView.class);
@Override
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request,
HttpServletResponse response) throws EgovBizException, IOException {
String path = (String) request.getAttribute("path");
path = path.replaceAll("\\.", "").replaceAll("/", "").replaceAll("\\\\", "");
if (StringUtils.isEmpty(path)) {
throw new EgovBizException("파일 경로가 올바르지 않습니다.");
}
File file = new File(path);
if (!file.exists()) {
throw new FileNotFoundException();
}
StreamingUtil su = new StreamingUtil();
OutputStream out = response.getOutputStream();
su.streaming(file, request, response, out);
}
}