kr.co.hit.live.repository
Interface FileRepository

All Known Implementing Classes:
FtpFileRepository, LocalFileRepository

public interface FileRepository

파일 저장/조회/삭제 기능을 제공하는 추상화된 레파지토리 인터페이스이다. 실제적인 구현은 FTP 서버나 로컬파일시스템 또는 DB 등을 사용하여 구현될 수 있다.

Since:
4.0
Author:
김형도

Method Summary
 boolean[] deleteFile(String[] filePath)
          레파지토리에서 파일을 삭제한다.
 boolean[] deleteFile(ValueObject fileVO, String pathKey)
          레파지토리에서 파일을 삭제한다.
 void getFile(ValueObject fileVO, String fileDataKey, String getPathKey)
          레파지토리에서 파일을 가져온다.
 void storeFile(String localPath, String remotePath)
          저장할 로컬 파일을 경로를 지정하여 해당 파일을 레파지토리에 저장한다.
 void storeFile(ValueObject fileVO, String fileDataKey, String rootPath, String getPathKey, String pathSuffix)
          파일데이터가 byte[] 담겨있는 VO를 받아서 레파지토리에 저장한다.
 

Method Detail

storeFile

void storeFile(ValueObject fileVO,
               String fileDataKey,
               String rootPath,
               String getPathKey,
               String pathSuffix)
               throws LiveException
파일데이터가 byte[] 담겨있는 VO를 받아서 레파지토리에 저장한다. 저장된 경로는 VO에 getPathKey로 담아준다. 파일명은 임의로 생성한다.

Parameters:
fileVO - 파일데이터가 byte[]로 담겨있는 VO
fileDataKey - fileVO에 파일데이터가 담겨있는 컬럼명
rootPath - 저장할 때 사용할 root 경로를 지정한다.
getPathKey - 저장 후 저장된 경로(자동생성)를 VO에 담아줄 때 사용할 컬럼명.
pathSuffix - 저장 경로를 자동생성시 주어진 값을 붙여준다.
Throws:
LiveException

storeFile

void storeFile(String localPath,
               String remotePath)
               throws LiveException
저장할 로컬 파일을 경로를 지정하여 해당 파일을 레파지토리에 저장한다.

Parameters:
localPath -
remotePath -
Throws:
LiveException

getFile

void getFile(ValueObject fileVO,
             String fileDataKey,
             String getPathKey)
             throws LiveException
레파지토리에서 파일을 가져온다. 가져올 파일 경로를 담은 컬럼명을 getPathKey로 지정한다. 파일 데이터는 byte[]로 fileVO에 저장되며 이때 저장할 컬럼명을 fileDataKey로 지정한다.

Parameters:
fileVO -
fileDataKey -
getPathKey -
Throws:
LiveException

deleteFile

boolean[] deleteFile(ValueObject fileVO,
                     String pathKey)
                     throws LiveException
레파지토리에서 파일을 삭제한다. 삭제할 파일 경로를 담은 컬럼명을 pathKey로 지정한다. 각 파일별로 삭제 성공여부를 boolean 배열로 반환한다.

Parameters:
fileVO -
pathKey -
Returns:
삭제 성공 여부
Throws:
LiveException

deleteFile

boolean[] deleteFile(String[] filePath)
                     throws LiveException
레파지토리에서 파일을 삭제한다. 삭제할 파일 경로들을 배열로 전달한다.

Parameters:
filePath으 -
Returns:
삭제 성공 여부
Throws:
LiveException


Copyright © 2014. All Rights Reserved.