Class RepositoryHelper

java.lang.Object
com.easydesk.util.RepositoryHelper

public class RepositoryHelper extends Object
Deprecated.
please use RepositoryService instead
EasyDesk System 에서 파일들의 저장/반출에 관한 helper class
Version:
$Id: RepositoryHelper.java,v 1.32 2008/04/26 05:36:05 youngho Exp $
Author:
Youngho Cho
  • Field Details

    • ATTRIBUTE_PREFIX

      public static final String ATTRIBUTE_PREFIX
      Deprecated.
      DOCUMENT ME!
      See Also:
    • ATTACHMENT_PREFIX

      public static final String ATTACHMENT_PREFIX
      Deprecated.
      DOCUMENT ME!
      See Also:
    • TEMP_FOLDER

      public static final String TEMP_FOLDER
      Deprecated.
      Item 등록시 임시 저장소
      See Also:
    • MODULE_OPTION_FOLDER

      public static final String MODULE_OPTION_FOLDER
      Deprecated.
      ModuleOption 들의 json file 저장소 Key
      See Also:
    • MODULE_CODE_PATH_PATTERN

      public static final Pattern MODULE_CODE_PATH_PATTERN
      Deprecated.
      경로에서 Module code 부분을 찾는 pattern
    • TEMPLATE_PATH_PATTERN

      public static final Pattern TEMPLATE_PATH_PATTERN
      Deprecated.
      ABC-1234 for template path or ABC1234 for resource path
    • ATTACHMENT_PATTERN

      public static final Pattern ATTACHMENT_PATTERN
      Deprecated.
      DOCUMENT ME!
    • LOCAL_RESOURCE_PATTERN

      public static final Pattern LOCAL_RESOURCE_PATTERN
      Deprecated.
      resouce file pattern 1 : ModuleCode info 2 : resource holder type 3 : name
    • DEDUPE_NAME_PATTERN

      public static final Pattern DEDUPE_NAME_PATTERN
      Deprecated.
      동일 이름이 존재할 경우 처리 Pattern *
    • supportedType

      public static final String[] supportedType
      Deprecated.
      DOCUMENT ME!
    • IMAGE_FILE_FILTER

      public static FileFilter IMAGE_FILE_FILTER
      Deprecated.
      DOCUMENT ME!
  • Constructor Details

    • RepositoryHelper

      public RepositoryHelper()
      Deprecated.
      새로운 RepositoryHelper 인스턴스를 생성한다.
  • Method Details

    • getDoumentRoot

      public static final File getDoumentRoot()
      Deprecated.
      문서의 Root Directory (FileSystem)
      Returns:
      문서의 Root Directory
    • getImageFileFilter

      public static final org.apache.commons.io.filefilter.IOFileFilter getImageFileFilter()
      Deprecated.
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • hasTemplatePath

      public static final boolean hasTemplatePath(String pathname)
      Deprecated.
      주어진 pathname 에 item uniqueId pattern 이 존재하는지 확인한다.
      Parameters:
      pathname - resource pathname
      Returns:
      true/false
    • getAttachmentIdFromPath

      public static final String getAttachmentIdFromPath(String pathname)
      Deprecated.
      DOCUMENT ME!
      Parameters:
      pathname - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getTempDirectory

      public static final File getTempDirectory(Module module)
      Deprecated.
      Module 의 임시 파일 저장소 item 등록시 임시 File 의 저장소이다
      Parameters:
      module - 대상 Module
      Returns:
      file
    • getRelativePath

      public static final String getRelativePath(File file) throws Exception
      Deprecated.
      DOCUMENT ME!
      Parameters:
      file - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • getRepositoryDirectory

      public static final String getRepositoryDirectory()
      Deprecated.
      Get the repository path info as given in the configuration. if the path begins with a '/', it is assumed to be absolute. Otherwise the path is constructed relative to the webapp directory. Windows note : windows 는 '/Drive: 와 같은 형태로 설정되어야 한다.
      Returns:
      repository directory 경로
      See Also:
    • getRelativePath

      public static final String getRelativePath(Item item, Object obj, String filename) throws Exception
      Deprecated.
      저장하고자 하는 파일의 Repository 상대 경로를 구한다.
      Parameters:
      item - 파일이 속한 item
      obj - attachment or attributeValue
      filename - 파일 이름
      Returns:
      Repository 에 대한 상대 경로
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
      UnsupportedOperationException - obj 가 User 인 경우
    • getFile

      public static final File getFile(String pathname)
      Deprecated.
      DOCUMENT ME!
      Parameters:
      pathname - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getRepository

      public static final File getRepository(Item item, Object obj, String filename) throws Exception
      Deprecated.
      Repository 를구한다.
      Parameters:
      item - 파일이 속한 item
      obj - attachment, attributeValue
      filename - 파일 이름
      Returns:
      File
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getItemRepoPath

      public static final String getItemRepoPath(Item item, Object obj, String filename) throws Exception
      Deprecated.
      Item 에 속한 파일 경로를 구한다. The path to an attachment file relative to the base file repository. Files are saved according to: moduleCode/(item_IdCount/1000)/itemID/attID/filename where moduleId and attId are primary keys of the related module and this attachment. itemID is the unique id generally used to specify the item within the ui. item_IdCount is the numerical suffix of the unique id. So if the pk of module PACS is 201 and this attachment pk is 123 the path would be: 201/0/PACS_5/123/diff.txt or if the item count were higher: 201/2/PACS_2115/123/diff.txt. The first two directories are used to keep the number of files per directory reasonable while the item unique id and the final textual filename allow someone browsing the file system to be better able to pick out relevant files. 주의 : ItemID 는 PACS-2 의 format 이고 path 에서는 PACS2 의 형태를 취한다.
      Parameters:
      item - 파일이 속한 item
      obj - attachment or attributeValue
      filename - 파일 이름
      Returns:
      Repository 에 대한 item 파일의 상대 경로
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getDedupeCheckFile

      public static File getDedupeCheckFile(String filename) throws IOException
      Deprecated.
      Repository 에 동일한 이름의 File 이 존재하면 파일이름에 (count) 를 추가한다.
      Parameters:
      filename - 확인할 파일 경로
      Returns:
      dedupe free file
      Throws:
      IOException - 파일 확인 중 오류가 발생한 경우
    • getOptionRepository

      public static File getOptionRepository(Module module, String name) throws Exception
      Deprecated.
      ModuleOption 의 json Repository File 를 구한다.
      Parameters:
      module - 대상 Module
      name - option 이름
      Returns:
      json Repository File
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRepository

      public static File getRepository(ModuleAttribute ma) throws Exception
      Deprecated.
      ModuleAttribute 의 json Repository File 를 구한다.
      Parameters:
      ma - 대상 ModuleAttribute
      Returns:
      json Repository File
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRepository

      public static File getRepository(Module module, String name) throws Exception
      Deprecated.
      Module Contents 의 Repository 를 구한다. ( EASYDESK-2805 )
      Parameters:
      module - 대상 Module
      name - contents 이름
      Returns:
      Repository File
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRepository

      public static File getRepository(Optionable optionable) throws Exception
      Deprecated.
      Optionable 의 json Repository File 를 구한다.
      Parameters:
      optionable - 대상 Optionable
      Returns:
      json Repository File
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRepository

      public static File getRepository(Attachment attachment) throws Exception
      Deprecated.
      please use repository.getRepository(attachment.getFileName()) instead
      Attachment 의 Repository File 를 구한다.
      Parameters:
      attachment - 대상 Attachment
      Returns:
      Repository File
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRepository

      public static File getRepository(AttributeValue value) throws Exception
      Deprecated.
      AttributeValue 의 Repository File 를 구한다.
      Parameters:
      value - 대상 AttributeValue
      Returns:
      Repository File
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRelativePath

      public static String getRelativePath(Optionable optionable) throws Exception
      Deprecated.
      Optionable 의 json getRelativePath 를 구한다. EASYDESK-2147 참조
      Parameters:
      optionable - 대상 Optionable
      Returns:
      class 이름(소문자)/optionable 이름.json 형식의 상대 경로
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRelativePath

      public static String getRelativePath(Attachment attachment) throws Exception
      Deprecated.
      Attachment getRelativePath 를 구한다.
      Parameters:
      attachment - 대상 Attachment
      Returns:
      Repository 에 대한 상대 경로
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRelativePath

      public static String getRelativePath(AttributeValue value) throws Exception
      Deprecated.
      AttributeValue getRelativePath 를 구한다.
      Parameters:
      value - 대상 AttributeValue
      Returns:
      Repository 에 대한 상대 경로
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getOptionRelativePath

      public static String getOptionRelativePath(Module module, String name) throws Exception
      Deprecated.
      ModuleOption 의 json getRelativePath 를 구한다.
      Parameters:
      module - 대상 Module
      name - option 이름
      Returns:
      Repository 에 대한 상대 경로
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRelativePath

      public static String getRelativePath(ModuleAttribute ma) throws Exception
      Deprecated.
      ModuleOption 의 json getRelativePath 를 구한다. EASYDESK-2147 참조
      Parameters:
      ma - 대상 ModuleAttribute
      Returns:
      Repository 에 대한 상대 경로
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRelativePath

      public static String getRelativePath(Module module, String name) throws Exception
      Deprecated.
      Module Contents 의 getRelativePath 를 구한다. ( EASYDESK-2805 )
      Parameters:
      module - 대상 Module
      name - contents 이름
      Returns:
      moduleCode/name 형식의 상대 경로
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getResource

      public static File getResource(Artifactizable artifactizable, String name) throws Exception
      Deprecated.
      Artifactizable 의 resource 파일을 구한다.
      Parameters:
      artifactizable - 대상 Artifactizable (현재는 Module 만 지원)
      name - resource 이름
      Returns:
      resource 파일
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
    • getRelativePath

      public static String getRelativePath(Artifactizable artifactizable, String name) throws Exception
      Deprecated.
      Artifactizable 의 resource 상대 경로를 구한다.
      Parameters:
      artifactizable - 대상 Artifactizable (현재는 Module 만 지원)
      name - resource 이름
      Returns:
      Repository 에 대한 상대 경로
      Throws:
      Exception - 경로를 구하는 중 오류가 발생한 경우
      UnsupportedOperationException - Module 이 아닌 경우