org.codelabor.system.file.manager
Class FileManagerImpl

java.lang.Object
  extended by org.codelabor.system.file.manager.FileManagerImpl
All Implemented Interfaces:
FileManager, org.springframework.beans.factory.InitializingBean

public class FileManagerImpl
extends java.lang.Object
implements FileManager, org.springframework.beans.factory.InitializingBean

파일 관리자 구현 클래스

Author:
Shin Sang-jae

Constructor Summary
FileManagerImpl()
           
 
Method Summary
 void afterPropertiesSet()
           
 int deleteAll()
          파일 매니저에 관리되는 모든 파일 정보를 삭제한다.
 int deleteFile(java.lang.String fileId)
          지정한 파일 ID에 해당하는 파일 정보를 삭제한다.
 int deleteFile(java.lang.String[] fileIdList)
          지정한 파일 ID에 해당하는 파일 정보를 삭제한다.
 int deleteFileByFileId(java.lang.String fileId)
          지정한 파일 ID에 해당하는 파일 정보를 삭제한다.
 int deleteFileByFileId(java.lang.String[] fileIdList)
          지정한 파일 ID에 해당하는 파일 정보를 삭제한다.
 int deleteFileByMapId(java.lang.String mapId)
          지정한 맵 ID에 해당하는 파일 정보를 삭제한다.
 int deleteFileByMapId(java.lang.String[] mapIdList)
          지정한 맵 ID에 해당하는 파일 정보를 삭제한다.
 FileDAO getFileDAO()
          파일 DAO를 가져온다.
 int insertFile(FileDTO fileDTO)
          파일 정보를 저장한다.
 int insertFile(java.util.List<FileDTO> fileDTOList)
          파일 정보를 저장한다.
 java.util.List<FileDTO> selectFile()
          현재 관리되고 있는 모든 파일 정보를 가져온다.
 java.util.List<FileDTO> selectFileAll()
          현재 관리되고 있는 모든 파일 정보를 가져온다.
 FileDTO selectFileByFileId(java.lang.String fileId)
          지정한 파일 ID에 해당하는 파일 정보를 가져온다.
 java.util.List<FileDTO> selectFileByMapId(java.lang.String mapId)
          지정한 매핑 ID와 연관된 파일들의 정보를 가져온다.
 java.util.List<FileDTO> selectFileByRepositoryType(RepositoryType repositoryType)
          현재 관리되고 있는 파일들 중 지정한 저장 방식(Repository Type)에 해당하는 파일 정보만 가져온다.
 void setFileDAO(FileDAO fileDAO)
          파일 DAO를 설정한다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileManagerImpl

public FileManagerImpl()
Method Detail

deleteAll

public int deleteAll()
              throws java.lang.Exception
Description copied from interface: FileManager
파일 매니저에 관리되는 모든 파일 정보를 삭제한다. 파일 저장 방식(Repository Type)이 FILE_SYSTEM인 경우, 파일 시스템에 저장한 물리적 파일은 삭제하지 않고 파일 정보만 삭제된다.

Specified by:
deleteAll in interface FileManager
Returns:
삭제 건수
Throws:
java.lang.Exception

deleteFile

public int deleteFile(java.lang.String fileId)
               throws java.lang.Exception
Description copied from interface: FileManager
지정한 파일 ID에 해당하는 파일 정보를 삭제한다. 파일 저장 방식(Repository Type)이 FILE_SYSTEM인 경우, 파일 시스템에 저장한 물리적 파일은 삭제하지 않고 파일 정보만 삭제된다.

Specified by:
deleteFile in interface FileManager
Parameters:
fileId - 파일 ID
Returns:
삭제 건수
Throws:
java.lang.Exception

deleteFile

public int deleteFile(java.lang.String[] fileIdList)
               throws java.lang.Exception
Description copied from interface: FileManager
지정한 파일 ID에 해당하는 파일 정보를 삭제한다. 파일 저장 방식(Repository Type)이 FILE_SYSTEM인 경우, 파일 시스템에 저장한 물리적 파일은 삭제하지 않고 파일 정보만 삭제된다.

Specified by:
deleteFile in interface FileManager
Parameters:
fileIdList - 파일 ID의 배열
Returns:
삭제 건수
Throws:
java.lang.Exception

deleteFileByFileId

public int deleteFileByFileId(java.lang.String fileId)
                       throws java.lang.Exception
Description copied from interface: FileManager
지정한 파일 ID에 해당하는 파일 정보를 삭제한다. 파일 저장 방식(Repository Type)이 FILE_SYSTEM인 경우, 파일 시스템에 저장한 물리적 파일은 삭제하지 않고 파일 정보만 삭제된다.

Specified by:
deleteFileByFileId in interface FileManager
Parameters:
fileId - 파일 ID
Returns:
삭제 건수
Throws:
java.lang.Exception

deleteFileByFileId

public int deleteFileByFileId(java.lang.String[] fileIdList)
                       throws java.lang.Exception
Description copied from interface: FileManager
지정한 파일 ID에 해당하는 파일 정보를 삭제한다. 파일 저장 방식(Repository Type)이 FILE_SYSTEM인 경우, 파일 시스템에 저장한 물리적 파일은 삭제하지 않고 파일 정보만 삭제된다.

Specified by:
deleteFileByFileId in interface FileManager
Parameters:
fileIdList - 파일 ID의 배열
Returns:
삭제 건수
Throws:
java.lang.Exception

deleteFileByMapId

public int deleteFileByMapId(java.lang.String mapId)
                      throws java.lang.Exception
Description copied from interface: FileManager
지정한 맵 ID에 해당하는 파일 정보를 삭제한다. 파일 저장 방식(Repository Type)이 FILE_SYSTEM인 경우, 파일 시스템에 저장한 물리적 파일은 삭제하지 않고 파일 정보만 삭제된다.

Specified by:
deleteFileByMapId in interface FileManager
Parameters:
mapId - 맵 ID
Returns:
삭제 건수
Throws:
java.lang.Exception

deleteFileByMapId

public int deleteFileByMapId(java.lang.String[] mapIdList)
                      throws java.lang.Exception
Description copied from interface: FileManager
지정한 맵 ID에 해당하는 파일 정보를 삭제한다. 파일 저장 방식(Repository Type)이 FILE_SYSTEM인 경우, 파일 시스템에 저장한 물리적 파일은 삭제하지 않고 파일 정보만 삭제된다.

Specified by:
deleteFileByMapId in interface FileManager
Parameters:
mapIdList - 맵 ID의 배열
Returns:
삭제 건수
Throws:
java.lang.Exception

insertFile

public int insertFile(FileDTO fileDTO)
               throws java.lang.Exception
Description copied from interface: FileManager
파일 정보를 저장한다. 파일 저장 방식(Repository Type)이 DATABASE인 경우, 파일의 내용이 BLOB 형태로 함께 저장되나, FILE_SYSTEM인 경우, 파일 정보만 저장된다.

Specified by:
insertFile in interface FileManager
Parameters:
fileDTO - 파일 DTO
Returns:
등록 건수
Throws:
java.lang.Exception

insertFile

public int insertFile(java.util.List<FileDTO> fileDTOList)
               throws java.lang.Exception
Description copied from interface: FileManager
파일 정보를 저장한다. 파일 저장 방식(Repository Type)이 DATABASE인 경우, 파일의 내용이 BLOB 형태로 함께 저장되나, FILE_SYSTEM인 경우, 파일 정보만 저장된다.

Specified by:
insertFile in interface FileManager
Parameters:
fileDTOList - 파일 DTO의 List
Returns:
등록 건수
Throws:
java.lang.Exception

selectFileByRepositoryType

public java.util.List<FileDTO> selectFileByRepositoryType(RepositoryType repositoryType)
                                                   throws java.lang.Exception
Description copied from interface: FileManager
현재 관리되고 있는 파일들 중 지정한 저장 방식(Repository Type)에 해당하는 파일 정보만 가져온다.

Specified by:
selectFileByRepositoryType in interface FileManager
Parameters:
repositoryType - 파일 저장 방식
Returns:
파일 DTO의 List
Throws:
java.lang.Exception

selectFileByMapId

public java.util.List<FileDTO> selectFileByMapId(java.lang.String mapId)
                                          throws java.lang.Exception
Description copied from interface: FileManager
지정한 매핑 ID와 연관된 파일들의 정보를 가져온다. 하나의 매핑 ID에 여러 파일들을 매핑할 수 있는데, 예를 들어 하나의 게시물에 여러 첨부 파일이 필요할 경우 활용된다.

Specified by:
selectFileByMapId in interface FileManager
Parameters:
mapId - 매핑 ID
Returns:
파일 DTO의 List
Throws:
java.lang.Exception

selectFileAll

public java.util.List<FileDTO> selectFileAll()
                                      throws java.lang.Exception
Description copied from interface: FileManager
현재 관리되고 있는 모든 파일 정보를 가져온다.

Specified by:
selectFileAll in interface FileManager
Returns:
파일 DTO의 List
Throws:
java.lang.Exception

selectFile

public java.util.List<FileDTO> selectFile()
                                   throws java.lang.Exception
Description copied from interface: FileManager
현재 관리되고 있는 모든 파일 정보를 가져온다.

Specified by:
selectFile in interface FileManager
Returns:
파일 DTO의 List
Throws:
java.lang.Exception

selectFileByFileId

public FileDTO selectFileByFileId(java.lang.String fileId)
                           throws java.lang.Exception
Description copied from interface: FileManager
지정한 파일 ID에 해당하는 파일 정보를 가져온다.

Specified by:
selectFileByFileId in interface FileManager
Parameters:
fileId - 파일 ID
Returns:
파일 DTO
Throws:
java.lang.Exception

getFileDAO

public FileDAO getFileDAO()
파일 DAO를 가져온다.

Returns:
파일 DAO

setFileDAO

public void setFileDAO(FileDAO fileDAO)
파일 DAO를 설정한다.

Parameters:
fileDAO -

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception


Copyright © 2011 CODELABOR. All Rights Reserved.