kr.co.hit.live.web.download
Class ScanFileDispatcherWebAction

java.lang.Object
  extended by kr.co.hit.live.web.action.AbstractWebAction
      extended by kr.co.hit.live.web.download.FileDispatcherWebAction
          extended by kr.co.hit.live.web.download.ScanFileDispatcherWebAction
All Implemented Interfaces:
WebAction

public class ScanFileDispatcherWebAction
extends FileDispatcherWebAction

특정 디렉토리 아래에 있는 파일들의 경로를 하위 디렉토리까지 탐색하여 미리 저장해 놓은 후 요청된 Request의 URI로 부터 파일 ID를 얻어와 해당 파일을 내려주는 방식의 FileDispatcher 구현이다.

Since:
5.0
Author:
kimhd

Field Summary
 
Fields inherited from class kr.co.hit.live.web.download.FileDispatcherWebAction
DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING
 
Fields inherited from class kr.co.hit.live.web.action.AbstractWebAction
context
 
Constructor Summary
ScanFileDispatcherWebAction()
           
 
Method Summary
protected  void dispatch(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          실제 파일을 데이터를 내려주는 메소드이다.
protected  String getFileID(String path, String pathSeperator)
          파일 경로로부터 파일 ID를 가져온다.
 void init()
          서버에 deploy된 파일들을 모두 검색해 놓은 후 그 경로를 이용하여 실제 파일경로를 얻어오도록 데이터를 구축한다.
 void setDir(String dir)
          파일을 탐색할 루트 경로를 지정한다.
 void setExtention(String extention)
          대상 파일의 확장자를 지정한다.
 
Methods inherited from class kr.co.hit.live.web.download.FileDispatcherWebAction
execute, getContentType, getDispatcher, getEncoding, getErrorPage, getExtention, initContentTypes, isModifiedSince, setContentType, setEncoding, setErrorPage, setNoCache, showConfiguration, writeHeader
 
Methods inherited from class kr.co.hit.live.web.action.AbstractWebAction
createForward, getServletContext, getWebApplicationContext, setForward, setPrefix, setSuffix, setWebApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScanFileDispatcherWebAction

public ScanFileDispatcherWebAction()
Method Detail

setDir

public void setDir(String dir)
파일을 탐색할 루트 경로를 지정한다.

Parameters:
dir -

setExtention

public void setExtention(String extention)
대상 파일의 확장자를 지정한다.

Parameters:
extention -

init

public void init()
서버에 deploy된 파일들을 모두 검색해 놓은 후 그 경로를 이용하여 실제 파일경로를 얻어오도록 데이터를 구축한다.


dispatch

protected void dispatch(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws IOException
Description copied from class: FileDispatcherWebAction
실제 파일을 데이터를 내려주는 메소드이다. 필요에 맞도록 구현한다.

Specified by:
dispatch in class FileDispatcherWebAction
Throws:
IOException

getFileID

protected String getFileID(String path,
                           String pathSeperator)
파일 경로로부터 파일 ID를 가져온다. 가져올 수 없으면 null을 반환한다.

Parameters:
path -
length -
Returns:


Copyright © 2014. All Rights Reserved.