請教各位,如何讀取war包中的檔案
專案要求我下載war包中的檔案,我在本地用weblogic釋出module的時候可以實現從工程目錄中下載,但是打成war包後,用weblogic釋出的時候卻拋FileNotFound Exception,請各位看看幫忙解決,不勝感激。
public static String getFileName( String pathKey, String fileNmKey, HttpServlet servlet) { String configBundleNm = "存放檔案路徑及檔名的資原始檔名"; String fullName = null; try { PropertyResourceBundle configBundle = (PropertyResourceBundle) PropertyResourceBundle.getBundle( configBundleNm, Locale.getDefault()); String fileName = (String) configBundle.getString(fileNmKey).trim(); String path = (String) configBundle.getString(pathKey).trim(); String fullPath = servlet.getServletContext().getRealPath(path); String fileSeparator = System.getProperties().getProperty("file.separator"); fullName = new StringBuffer() .append(fullPath) .append(fileSeparator) .append(fileName) .toString(); } catch (MissingResourceException missE) { } File file = new File(fullName); if (!file.isFile()) { } return fullName; } |
相關文章
- 如何在python中讀取配置檔案Python
- rpm包的校驗和檔案讀取
- 請教各位大佬一個問題,flutter APP 怎麼抓包呢?FlutterAPP
- Springboot 獲取jar包中的檔案Spring BootJAR
- 說說在 Python 中,如何讀取檔案中的資料Python
- python如何讀取大檔案Python
- 如何在Shell指令碼中逐行讀取檔案指令碼
- python中xlrd庫如何實現檔案讀取?Python
- Java讀取properties配置檔案工具包Java
- java中讀取配置檔案Java
- spring boot 打war包後沒有配置檔案Spring Boot
- Golang專案中讀取配置檔案Golang
- .NET Core中如何讀取appsetting.json配置檔案APPJSON
- Go如何自動解壓縮包?如何讀取docx/doc檔案內容?Go
- springboot 執行 jar 包讀取外部配置檔案Spring BootJAR
- Java中的獲取檔案的物理絕對路徑,和讀取檔案Java
- 06、使用Gradle構建的專案如何打jar包和war包GradleJAR
- js檔案中如何讀取app.ux中的全域性變數JSAPPUX變數
- SpringBoot打jar包或war包獲取不到資原始檔解決辦法Spring BootJAR
- 如何在Java中讀取超過記憶體大小的檔案Java記憶體
- 如何使用File APIs來讀取檔案API
- 如何讀取和寫入JSON檔案JSON
- 有關theano配置問題想請教各位大佬
- 徹底解決java WEB專案的檔案路徑問題(war包)JavaWeb
- 教大家python讀取一行一行檔案內容的方法Python
- go–讀取檔案的方式Go
- 任意檔案讀取
- Java 讀取檔案Java
- springboot專案打war包流程Spring Boot
- php如何上傳txt檔案,並且讀取txt檔案PHP
- Spring Boot啟動後讀取jar包內部檔案Spring BootJAR
- 如何將War檔案部署到Spring Boot嵌入式的Tomcat中 - Vojtech RuzickaSpring BootTomcat
- python中按照資料夾中檔案的排列順序讀取檔案內容Python
- 深入理解 Laravel 中.env 檔案讀取Laravel
- spark直接讀取本地檔案系統的檔案Spark
- Python中Spark讀取parquet檔案並獲取schema的JSON表示PythonSparkJSON
- Android讀取配置檔案的方法Android
- go配置檔案讀取Go
- python讀取大檔案Python