Class DispatchFileStorageDao
java.lang.Object
ru.bitel.bgbilling.plugins.dispatch.server.dao.DispatchFileStorageDao
public class DispatchFileStorageDao
extends java.lang.Object
DAO для работы с файлами рассылок. Вместо работы с этим DAO рекомендуется работать с
DispatchService-
Constructor Summary
Constructors Constructor Description DispatchFileStorageDao(java.sql.Connection con, ru.bitel.bgbilling.kernel.plugin.server.BGPluginServer plugin) -
Method Summary
Modifier and Type Method Description voiddeleteByObject(Id o)Удаляет все файлы, привязанные к данной сущностиvoiddeleteFile(int fileId)Удаление файла с указанным кодомjavax.activation.DataSourcegetDataSource(BGServerFile serverFile)java.io.FileInputStreamgetFileInputStream(int fileId)Возврвщает поток для чтения файла с указанным кодомjava.util.List<BGServerFile>getFileList(Id object)Возвращает список всех привязанных к данной сущности файловBGServerFilegetServerFile(int fileId)Возвращает BGServerFile для данного кода файлаBGServerFileuploadFile(Id object, java.lang.String fileName, byte[] fileData)Загрузить файл, привязанный к данной сущностиMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DispatchFileStorageDao
public DispatchFileStorageDao(java.sql.Connection con, ru.bitel.bgbilling.kernel.plugin.server.BGPluginServer plugin) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
-
Method Details
-
uploadFile
public BGServerFile uploadFile(Id object, java.lang.String fileName, byte[] fileData) throws ru.bitel.bgbilling.common.BGExceptionЗагрузить файл, привязанный к данной сущности- Parameters:
object- сущность плагина рассылокfileName- имя файлаfileData- содержимое файла- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
deleteFile
public void deleteFile(int fileId) throws ru.bitel.bgbilling.common.BGExceptionУдаление файла с указанным кодом- Parameters:
fileId-- Throws:
ru.bitel.bgbilling.common.BGException
-
getFileInputStream
public java.io.FileInputStream getFileInputStream(int fileId) throws java.io.IOExceptionВозврвщает поток для чтения файла с указанным кодом- Parameters:
fileId-- Returns:
- Throws:
ru.bitel.bgbilling.common.BGExceptionjava.io.IOException
-
getServerFile
Возвращает BGServerFile для данного кода файла- Parameters:
fileId-- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
getFileList
public java.util.List<BGServerFile> getFileList(Id object) throws ru.bitel.bgbilling.common.BGExceptionВозвращает список всех привязанных к данной сущности файлов- Parameters:
object-- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
deleteByObject
Удаляет все файлы, привязанные к данной сущности- Parameters:
o-- Throws:
ru.bitel.bgbilling.common.BGException
-
getDataSource
-