public interface FileManager
限定符和类型 | 方法和说明 |
---|---|
V3XFile |
clone(Long originalFileId)
复制一个文件,现从文件总表中根据originalFileId读取文件信息,再复制文件,设置新的fileId,文件名称前加copy
用于office控件清稿备份
|
V3XFile |
clone(Long originalFileId,
boolean saveDB)
复制一个文件,现从文件总表中根据originalFileId读取文件信息,再复制文件,设置新的fileId
|
void |
clone(Long originalFileId,
Date originalCreateDate,
Long newFileId,
Date newCreateDate)
根据originalFileId和createDate能够定位文件物理位置,并按照新的创建时间复制
|
Long |
copyFileBeforeModify(Long fileId)
在进行编辑上传类型的文件时,替换之前保存一份历史,区别于正常的替换
|
void |
copyWPS(Long sourceId)
手动备份WPS的上传类型----文字和表格,备份的命名规则和普通office相同,见HandWriterManage.java----L340
|
List<V3XFile> |
create(ApplicationCategoryEnum category,
javax.servlet.http.HttpServletRequest request)
从前端通过v3x:fileupload组件上传的文件直接存到文件系统中去
该方法不负责文件的上传 |
File |
decryptionFile(File file)
解密文件。
|
void |
deleteFile(Long fileId,
Boolean deletePhysicsFile)
删除文件
|
void |
deleteFile(Long fileId,
Date createDate,
Boolean deletePhysicsFile)
删除文件
|
void |
deletePhysicsFile(Long fileId)
删除物理文件
|
List<V3XFile> |
findByFileName(String fileName) |
File |
getFile(Long fileId)
根据文件Id,获得文件对象
|
File |
getFile(Long fileName,
Date createDate)
根据文件名和文件生成时间,获得文件对象
|
byte[] |
getFileBytes(Long fileId)
得到文件字节
|
byte[] |
getFileBytes(Long fileId,
Date createDate)
得到文件字节
|
File |
getFileDecryption(Long fileId)
获取解密后的文件
|
File |
getFileDecryption(Long fileId,
Date createDate)
获取解密后的文件
|
File |
getFileForUC(Long fileId,
Date createDate)
致信端获取文件特殊处理
|
Long |
getFileIdByDocResSourceId(Long fileId)
通过文档的sourceId获得file
|
InputStream |
getFileInputStream(Long fileId)
得到文件IO
|
InputStream |
getFileInputStream(Long fileId,
Date createDate)
得到文件IO
|
InputStream |
getFileInputStreamForUC(Long fileId,
Date createDate)
致信文件服务,提供的接口,为避免影响原来的内容,添加新接口
|
String |
getFolder(Date createDate,
boolean createWhenNoExist)
根据文件创建时间,获取文件上传目录,目录结构: 分区目录/yyyy/MM/dd
如: F:/upload/2006/05/09 |
String |
getNowFolder(boolean createWhenNoExist)
得到当前的存储路径,目录结构: 分区目录/yyyy/MM/dd
|
File |
getSpicFile(Long fileId,
boolean decryption)
根据是否需要解密获取文件
|
File |
getStandardOffice(Long fileId,
Date createDate)
得到Office正文的标准格式
|
File |
getStandardOffice(String fileAbsolutePath)
传入文件绝对路径
|
InputStream |
getStandardOfficeInputStream(Long fileId,
Date createDate)
得到Office正文的标准格式
|
File |
getThumFile(Long fileId,
Date createDate)
取得缩略图,大小默认600
|
File |
getThumFile(Long fileId,
Date createDate,
int px) |
File |
getThumFileForUC(Long fileId,
Date createDate,
String pxStr)
致信端获取文件的缩略图
|
V3XFile |
getV3XFile(Long fileId)
得到V3XFile文件对象
|
List<V3XFile> |
getV3XFile(Long[] fileIds)
得到V3XFile文件对象
|
V3XFile |
save(File file,
ApplicationCategoryEnum category,
String filename,
Date createDate,
Boolean isSaveToDB)
把文件存到文件系统中去
|
V3XFile |
save(InputStream in,
ApplicationCategoryEnum category,
String filename,
Date createDate,
Boolean isSaveToDB)
把输入流存到文件系统中去
|
V3XFile |
save(String bodyData,
ApplicationCategoryEnum category,
String filename,
Date createDate,
Boolean isSaveToDB)
把文本存到文件系统中去
|
void |
save(V3XFile file)
记录文件信息,只在文件表中记录信息,文件是否已经上传不关心
|
void |
update(V3XFile file) |
Map<String,V3XFile> |
uploadFiles(javax.servlet.http.HttpServletRequest request,
Long memberId,
Long accountId,
String allowExtensions,
Long maxSize)
通过Portlet方式上传多个文件
只负责把文件存放在硬盘上 不把文件信息写进v3x_file表 |
Map<String,V3XFile> |
uploadFiles(javax.servlet.http.HttpServletRequest request,
String allowExtensions,
File destFile,
Long maxSize)
通过Portlet方式上传一个文件
只负责把文件存放在指定的位置 不把文件信息写进v3x_file表 约定: <input type='file' name='file1'> 的name为file1 |
Map<String,V3XFile> |
uploadFiles(javax.servlet.http.HttpServletRequest request,
String allowExtensions,
Long maxSize)
通过Portlet方式上传多个文件
只负责把文件存放在硬盘上 不把文件信息写进v3x_file表 |
Map<String,V3XFile> |
uploadFiles(javax.servlet.http.HttpServletRequest request,
String allowExtensions,
Map<String,File> destFiles,
Long maxSize)
通过Portlet方式上传一个文件
只负责把文件存放在指定的位置 不把文件信息写进v3x_file表 |
Map<String,V3XFile> |
uploadFiles(javax.servlet.http.HttpServletRequest request,
String allowExtensions,
String destDirectory,
Long maxSize)
通过Portlet方式上传多个文件
只负责把文件存放在指定的位置 不把文件信息写进v3x_file表 |
void save(V3XFile file)
file
- void update(V3XFile file)
V3XFile save(File file, ApplicationCategoryEnum category, String filename, Date createDate, Boolean isSaveToDB) throws BusinessException
file
- 要保存的文件对象category
- 所属应用类别filename
- 显示文件名createDate
- 文件存储日期,一般就是此刻,用new Date()isSaveToDB
- 是否把V3XFile对象存到数据库中去,如果不存,在清理文件时将会被清理掉BusinessException
V3XFile save(InputStream in, ApplicationCategoryEnum category, String filename, Date createDate, Boolean isSaveToDB) throws BusinessException
in
- category
- 所属应用类别filename
- 显示文件名createDate
- 文件存储日期,一般就是此刻,用new Date()isSaveToDB
- 是否把V3XFile对象存到数据库中去,如果不存,在清理文件时将会被清理掉BusinessException
V3XFile save(String bodyData, ApplicationCategoryEnum category, String filename, Date createDate, Boolean isSaveToDB) throws BusinessException
bodyData
- 文本内容category
- 所属分类filename
- 显示文件名createDate
- 文件存储日期,一般就是此刻,用new Date()isSaveToDB
- 是否把V3XFile对象存到数据库中去,如果不存,在清理文件时将会被清理掉BusinessException
List<V3XFile> create(ApplicationCategoryEnum category, javax.servlet.http.HttpServletRequest request) throws BusinessException
category
- request
- BusinessException
String getNowFolder(boolean createWhenNoExist) throws BusinessException
createWhenNoExist
- BusinessException
String getFolder(Date createDate, boolean createWhenNoExist) throws BusinessException
createDate
- 文件创建时间createWhenNoExist
- 当不存在该文件夹时创建之BusinessException
- 没有分区V3XFile getV3XFile(Long fileId) throws BusinessException
fileId
- BusinessException
List<V3XFile> getV3XFile(Long[] fileIds) throws BusinessException
fileId
- BusinessException
File getFile(Long fileId) throws BusinessException
fileId
- BusinessException
- 文件不存在File getFile(Long fileName, Date createDate) throws BusinessException
fileName
- 对应file表中的id,attachment表的fileurlcreateDate
- 文件不存在BusinessException
File getFileForUC(Long fileId, Date createDate) throws BusinessException
fileId
- createDate
- BusinessException
File getThumFile(Long fileId, Date createDate, int px) throws BusinessException
File getThumFileForUC(Long fileId, Date createDate, String pxStr) throws BusinessException
fileId
- createDate
- px
- BusinessException
File getThumFile(Long fileId, Date createDate) throws BusinessException
fileId
- createDate
- BusinessException
InputStream getFileInputStream(Long fileId) throws BusinessException
fileId
- BusinessException
InputStream getFileInputStream(Long fileId, Date createDate) throws BusinessException
fileId
- createDate
- BusinessException
InputStream getFileInputStreamForUC(Long fileId, Date createDate) throws BusinessException
fileId
- createDate
- BusinessException
byte[] getFileBytes(Long fileId) throws BusinessException
fileId
- BusinessException
byte[] getFileBytes(Long fileId, Date createDate) throws BusinessException
fileId
- BusinessException
Map<String,V3XFile> uploadFiles(javax.servlet.http.HttpServletRequest request, String allowExtensions, Long maxSize) throws BusinessException
request
- allowExtensions
- 允许的后缀名,多个用,分割,如: jpeg,jpg,gif,png,不区分大小写,可以为空maxSize
- 最大byteBusinessException
Map<String,V3XFile> uploadFiles(javax.servlet.http.HttpServletRequest request, String allowExtensions, File destFile, Long maxSize) throws BusinessException
<input type='file' name='file1'>
的name为file1request
- allowExtensions
- 允许的后缀名,多个用,分割,如: jpeg,jpg,gif,png,不区分大小写,可以为空destFile
- 指定的文件名,采用全名,如c:\ext\log.txtmaxSize
- 最大byteBusinessException
Map<String,V3XFile> uploadFiles(javax.servlet.http.HttpServletRequest request, String allowExtensions, Map<String,File> destFiles, Long maxSize) throws BusinessException
request
- allowExtensions
- destFiles
- MapBusinessException
Map<String,V3XFile> uploadFiles(javax.servlet.http.HttpServletRequest request, String allowExtensions, String destDirectory, Long maxSize) throws BusinessException
request
- allowExtensions
- 允许的后缀名,多个用,分割,如: jpeg,jpg,gif,png,不区分大小写,可以为空type
- destDirectory
- 上传到指定的文件夹maxSize
- 最大byteBusinessException
Map<String,V3XFile> uploadFiles(javax.servlet.http.HttpServletRequest request, Long memberId, Long accountId, String allowExtensions, Long maxSize) throws BusinessException
request
- allowExtensions
- 允许的后缀名,多个用,分割,如: jpeg,jpg,gif,png,不区分大小写,可以为空maxSize
- 最大bytememberId
- 用户编号accountId
- 单位编号BusinessException
void deleteFile(Long fileId, Boolean deletePhysicsFile) throws BusinessException
fileId
- deletePhysicsFile
- 是否删除物理文件BusinessException
void deleteFile(Long fileId, Date createDate, Boolean deletePhysicsFile) throws BusinessException
fileId
- createDate
- deletePhysicsFile
- 是否删除物理文件BusinessException
V3XFile clone(Long originalFileId, boolean saveDB) throws BusinessException, FileNotFoundException
originalFileId
- 要复制的文件的idsaveDB
- 是否同时保存到数据库BusinessException
FileNotFoundException
V3XFile clone(Long originalFileId) throws BusinessException, FileNotFoundException
originalFileId
- 要复制的文件的idBusinessException
FileNotFoundException
void clone(Long originalFileId, Date originalCreateDate, Long newFileId, Date newCreateDate) throws BusinessException, FileNotFoundException
originalFileId
- originalCreateDate
- newFileId
- newCreateDate
- BusinessException
FileNotFoundException
File getStandardOffice(Long fileId, Date createDate) throws BusinessException
fileId
- createDate
- BusinessException
InputStream getStandardOfficeInputStream(Long fileId, Date createDate) throws BusinessException, FileNotFoundException
fileId
- createDate
- BusinessException
FileNotFoundException
void copyWPS(Long sourceId)
File getStandardOffice(String fileAbsolutePath) throws BusinessException
File decryptionFile(File file)
file
- 被加密的文件File getFileDecryption(Long fileId, Date createDate) throws BusinessException
fileId
- createDate
- BusinessException
File getFileDecryption(Long fileId) throws BusinessException
fileId
- BusinessException
File getSpicFile(Long fileId, boolean decryption) throws BusinessException
fileId
- decryption
- true:需要解密,false不需要解密BusinessException
void deletePhysicsFile(Long fileId) throws BusinessException
fileId
- BusinessException
Copyright © 2016–2018. All rights reserved.