How to read a folder inside resources of oxygen plugin jar
Posted: Wed Aug 24, 2022 4:16 pm
Hello Team , this might be a general java question , we have a requirement where we have a DB wallet folder inside resources
like oxygen-plugin-project\src\main\resources\Wallet_DB (this folder contains the information to connect to JDBC)
and we tried reading the same folder path inside public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess)
as below
String folderPath=xxxWorkspaceAccessPluginExtension.class.getClassLoader().getResource("Wallet_DB ").getPath();
folderPath=folderPath.replaceAll("file:","");
System.out.println("folderPath" + folderPath);
String DB_URL = "jdbc:oracle:thin:@devdb_medium?TNS_ADMIN="+folderPath;
but the folderPath throwing null pointer exception
like oxygen-plugin-project\src\main\resources\Wallet_DB (this folder contains the information to connect to JDBC)
and we tried reading the same folder path inside public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess)
as below
String folderPath=xxxWorkspaceAccessPluginExtension.class.getClassLoader().getResource("Wallet_DB ").getPath();
folderPath=folderPath.replaceAll("file:","");
System.out.println("folderPath" + folderPath);
String DB_URL = "jdbc:oracle:thin:@devdb_medium?TNS_ADMIN="+folderPath;
but the folderPath throwing null pointer exception