1 33 package net.myvietnam.mvncore.service; 34 35 import java.io.*; 36 37 public interface BinaryStorage { 38 39 public static final int BINARY_STORAGE_TYPE_DISK = 1; 40 41 public static final int BINARY_STORAGE_TYPE_DATABASE = 2; 42 43 public static final String CATEGORY_POST_ATTACHMENT = "PostAttachment"; 44 45 public static final String CATEGORY_PM_ATTACHMENT = "PmAttachment"; 46 47 public static final String CATEGORY_AVATAR = "AvatarAttachment"; 48 49 public static final String BINARY_STORAGE = "BinaryStorage"; 50 51 public BinaryStorageHandle storeData(String category, 52 String nameId, 53 String fileName, 54 byte[] data, 55 int attachDataFileSize, 56 int attachOption, 57 int attachStatus, 58 String contentType, 59 String storageIP) throws IOException; 60 61 public BinaryStorageHandle storeData(String category, 62 String nameId, 63 String fileName, 64 InputStream inputStream, 65 int attachDataFileSize, 66 int attachOption, 67 int attachStatus, 68 String contentType, 69 String storageIP) throws IOException; 70 71 public byte[] loadData(String category, String nameId, BinaryStorageHandle handle) 72 throws IOException; 73 74 public InputStream getInputStream(String category, String nameId, BinaryStorageHandle handle) 75 throws IOException; 76 77 public void deleteData(String category, String nameId, BinaryStorageHandle handle) 78 throws IOException; 79 80 public void updateData(String category, String nameId, BinaryStorageHandle handle) 81 throws IOException; 82 83 } 84 | Popular Tags |