Does anyone know how to get programmatically the absolute path in the filesystem for an EAR deployed in JBoss, from Java code within that same EAR?
I need this because I want to copy some files that are inside the EAR to another part of the filesystem, on deploy-time.
Thank you everyone!
Deploying on a running JBoss Web server WAR is dropped into the ${jboss. server. base. dir}/standalone/deployments/ directory it will be deployed automaticly.
The uploaded war is stored in a file called /data/content/ad/xxxxx/content where xxxxx is some temporary directory name. When JBoss is running the exploded contents of your war will be in the /tmp/vfs/temp/tempxxxxxxx/content-yyyyyyy where xxxxxxx and yyyyyyy are random hex values.
you can do you "System.getProperty()" here is the link for other the properties you can used
ex:
String jBossPath = System.getProperty("jboss.server.base.dir")
result
"/Users/ALL_THE_PATH/JBoss_7-1/standelone"
After you just need to add "/deployments/YOUR_PROJECT_EAR/..."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With