![](/img/trans.png)
[英]Veracode Insecure Temporary File error when using java.io.File.createTempFile
[英]create temp file using utils in java not using : java.io.File.createTempFile()
目前,我正在使用java.io.File.createTempFile()
創建一個臨時文件。 但是它可以過濾掉少於3個單詞的文件名。 像這樣
if (prefix.length() < 3)
throw new IllegalArgumentException("Prefix string too short");
但我想考慮標題長度可以為1的情況。因此,任何人都可以建議一個好的替代API或任何公共api來創建臨時文件。
謝謝。
也許這應該做你想要的:
File f = new File(FileUtils.getTempDirectoryPath() + filename);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.