kr.co.hit.live.repository
Class FtpFileRepository

java.lang.Object
  extended by kr.co.hit.live.repository.FtpFileRepository
All Implemented Interfaces:
FileRepository

public class FtpFileRepository
extends Object
implements FileRepository

FileRepository의 FTP 구현 클래스이다.

Since:
4.0
Author:
김형도

Constructor Summary
FtpFileRepository(String key)
           
 
Method Summary
 boolean[] deleteFile(String[] filePath)
          레파지토리에서 파일을 삭제한다.
 boolean[] deleteFile(ValueObject fileVO, String pathKey)
          FTP 서버에서 파일을 삭제한다.
 void getFile(ValueObject fileVO, String fileDataKey, String getPathKey)
          FTP 서버에서 파일을 가져온다.
 void storeFile(String localPath, String remotePath)
          저장할 로컬 파일을 경로를 지정하여 해당 파일을 레파지토리에 저장한다.
 void storeFile(ValueObject fileVO, String fileDataKey, String rootPath, String getPathKey, String pathSuffix)
          파일데이터가 byte[] 담겨있는 VO를 받아서 FTP 서버에 저장한다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FtpFileRepository

public FtpFileRepository(String key)
Method Detail

storeFile

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

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

storeFile

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

Specified by:
storeFile in interface FileRepository
Throws:
LiveException

getFile

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

Specified by:
getFile in interface FileRepository
Parameters:
fileVO -
fileDataKey -
getPathKey -
Throws:
LiveException

deleteFile

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

Specified by:
deleteFile in interface FileRepository
Parameters:
fileVO -
pathKey -
Returns:
Throws:
LiveException

deleteFile

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

Specified by:
deleteFile in interface FileRepository
Returns:
삭제 성공 여부
Throws:
LiveException


Copyright © 2014. All Rights Reserved.