private static Map < String , Attachment > buildAttachmentDB ( ) throws IOException { Map < String , Attachment > map = new TreeMap < String , Attachment > ( String . CASE_INSENSITIVE_ORDER ) ; if ( MonomerStoreConfiguration . getInstance ( ) . isUseExternalAttachments ( ) ) { map = AttachmentLoader . loadAttachments ( new FileInputStream ( MonomerStoreConfiguration . getInstance ( ) . getExternalAttachmentsPath ( ) ) ) ; } else { InputStream in = MonomerFactory . class . getResourceAsStream ( ATTACHMENTS_RESOURCE ) ; map = AttachmentLoader . loadAttachments ( in ) ; } return map ; }
builds attachment db from default file or external file