Page 1 of 1

Getting the Servoy application_server directory after deploy

PostPosted: Thu Nov 25, 2021 3:54 am
by roddy
In order to get files deployed with Servoy under the application_server directory, is there a function to retrieve where the deployment has placed this?

The plugins.UserManager.Server().servoyDirectory returns the location in the application correctly but after deployment it is returning:
/usr/home/servoy/.servoy/server/cesoft

which doesn't seem correct. Have tried to find this in the documention like https://wiki.servoy.com/display/DOCS/Application+Server but to no avail. Can anyone help with this?

Re: Getting the Servoy application_server directory after de

PostPosted: Thu Nov 25, 2021 10:30 am
by jcompagner
that is the correct dir, because that is where stuff like logging and the settings are written to.
Because what else do you want to have? if you use a Servlet Container (like Tomcat) that doesn't extract the WAR but runs directly from the war there is no directory what so ever.
Everything is just in a compressed file (the war)
So what are you trying todo? You just shouldn't really expect that you have file access to that area.

Re: Getting the Servoy application_server directory after de

PostPosted: Fri Nov 26, 2021 12:53 am
by roddy
Hi,

Thanks for the response; this relates to the previous post about the PDF Viewer plugin. It requires the files to be placed into a location accessible by a URL, so it needs to be within the server/webapps/ROOT/ folder structure.

Our structure has also been setup with templates that are stored within a directory off the Servoy server folder; we can configure this path for Velocity in the plugin settings but the other report generator we are using is not setup that way, so I needed to know where the server folder was to locate the template. While developing the application, I've at points needed to know the location for the server folder. This can be retrieved by plugins.UserManager.Server().servoyDirectory in the IDE but returns a different location once deployed which cannot be used to locate any sub-directories.

If we were to use the one supplied post-deployment, we would need to be able to confirm this was consistent to allow the deployment script to utilise it.

Re: Getting the Servoy application_server directory after de

PostPosted: Fri Nov 26, 2021 2:51 am
by roddy
We are going to refactor this functionality with the plugins.file.getUrlForRemoteFile(file) that we have been informed about and see how that goes.

Re: Getting the Servoy application_server directory after de

PostPosted: Fri Nov 26, 2021 10:08 am
by jcompagner
we also have plugins.file.streamFile(xxxxx)

that can stream any file on disk to the browser. (not just remote files)