Getting the Servoy application_server directory after deploy

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Getting the Servoy application_server directory after deploy

Postby roddy » Thu Nov 25, 2021 3:54 am

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?
roddy
 
Posts: 80
Joined: Mon Oct 26, 2020 12:32 am

Re: Getting the Servoy application_server directory after de

Postby jcompagner » Thu Nov 25, 2021 10:30 am

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.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8460
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Getting the Servoy application_server directory after de

Postby roddy » Fri Nov 26, 2021 12:53 am

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.
roddy
 
Posts: 80
Joined: Mon Oct 26, 2020 12:32 am

Re: Getting the Servoy application_server directory after de

Postby roddy » Fri Nov 26, 2021 2:51 am

We are going to refactor this functionality with the plugins.file.getUrlForRemoteFile(file) that we have been informed about and see how that goes.
roddy
 
Posts: 80
Joined: Mon Oct 26, 2020 12:32 am

Re: Getting the Servoy application_server directory after de

Postby jcompagner » Fri Nov 26, 2021 10:08 am

we also have plugins.file.streamFile(xxxxx)

that can stream any file on disk to the browser. (not just remote files)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8460
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Programming with Servoy

Who is online

Users browsing this forum: Bing [Bot] and 14 guests

cron