Class FileUtils
java.lang.Object
com.sankcrm.erp.contract.infrastructure.FileUtils
文件工具
- Since:
- 1.0.0
- Author:
- zhsxin
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void检查目录是否存在static void保存文件static Optional<com.itextpdf.kernel.font.PdfFont> 字体路径static com.itextpdf.layout.font.FontProvider字体提供者获取合同CA信息列表static String文件名合同html文件路径static voidhtml转pdfstatic InputStreamstatic String文件名合同日志文件路径static PathnewAuthFile(ContractAuth auth, String fileType) 新建文件路径static Path文件路径static Pathpath(ContractTemplate template) 模板路径static String文件名合同pdf文件路径pdfPath(ContractTemplate template) 合同模板pdf文件路径读取文件readVm(ContractTemplate template) 读取模板文件static Stringsave(String path, com.sankcrm.erp.contract.domain.model.ContractId serialNo, String tempHtml, String html) Deprecated, for removal: This API element is subject to removal in a future version.static StringsaveAuthFile(ContractAuth auth, String fileType, InputStream in) 保存视频文件static String保存文件static void保存static voidstatic Pathstatic voidstreamCopy(jakarta.servlet.http.HttpServletResponse response, Path filePath, Supplier<FileUtils.FileDesc> nameSup) 合同流static String文件名合同vm文件路径vmPath(ContractTemplate template) 合同vm文件路径
-
Constructor Details
-
FileUtils
-
-
Method Details
-
fontProvider
public static com.itextpdf.layout.font.FontProvider fontProvider()字体提供者- Returns:
- 字体提供者
- Since:
- 1.2.0
-
fontPath
字体路径- Returns:
- 字体路径
-
doSave
保存文件- Parameters:
path- 文件路径html- 文件内容
-
checkDir
检查目录是否存在- Parameters:
path- 目录
-
htmlToPdf
html转pdf- Parameters:
htmlStr- html内容pdfPath- pdf文件路径
-
saveHtml
-
save
@Deprecated(forRemoval=true, since="1.4.0") public static String save(String path, com.sankcrm.erp.contract.domain.model.ContractId serialNo, String tempHtml, String html) Deprecated, for removal: This API element is subject to removal in a future version.保存文件- Parameters:
path- 文件路径tempHtml- 模板内容html- 文件内容- Returns:
- 文件路径
-
saveFrom
public static String saveFrom(String path, com.sankcrm.erp.contract.domain.model.ContractId serialNo, String url) 保存文件- Parameters:
path- 文件路径serialNo- 合同idurl- 文件url- Returns:
- 文件路径
-
path
文件路径- Parameters:
contract- 模板- Returns:
- 模板路径
- Since:
- 1.4.0
-
path
模板路径- Parameters:
template- 模板- Returns:
- 模板路径
- Since:
- 1.4.0
-
saveFrom
保存- Parameters:
path- 保存路径url- 文件- Since:
- 1.4.0
-
inFrom
- Throws:
Exception
-
saveAuthFile
保存视频文件- Parameters:
auth- 认证记录fileType- 文件类型in- 文件流- Returns:
- 保存的路径
-
newAuthFile
新建文件路径- Parameters:
auth- 认证fileType- 文件类型- Returns:
- 文件路径
-
vmName
文件名- Parameters:
name- 文件名- Returns:
- 文件名
-
htmlName
文件名- Parameters:
name- 文件名- Returns:
- 文件名
-
logName
文件名- Parameters:
name- 文件名- Returns:
- 文件名
-
pdfName
文件名- Parameters:
name- 文件名- Returns:
- 文件名
-
read
读取文件- Parameters:
path- 文件路径- Returns:
- 文件内容
-
readVm
读取模板文件- Parameters:
template- 模板- Returns:
- 文件内容
-
htmlPath
合同html文件路径- Parameters:
contract- 合同- Returns:
- 文件内容
-
vmPath
合同vm文件路径- Parameters:
template- 合同- Returns:
- 文件内容
- Since:
- 1.4.0
-
vmPath
合同vm文件路径- Parameters:
contract- 合同- Returns:
- 文件内容
-
pdfPath
合同pdf文件路径- Parameters:
contract- 合同- Returns:
- 文件路径
-
logPath
合同日志文件路径- Parameters:
contract- 合同- Returns:
- 文件路径
-
saveLogs
-
pdfPath
合同模板pdf文件路径- Parameters:
template- 模板- Returns:
- 文件路径
-
getCAInfo
获取合同CA信息列表- Parameters:
contract- 合同- Returns:
- CA信息列表
-
streamCopy
public static void streamCopy(jakarta.servlet.http.HttpServletResponse response, Path filePath, Supplier<FileUtils.FileDesc> nameSup) 合同流- Parameters:
response- 响应filePath- 路径
-