Programmatically storing image files in JBoss [closed]

给你一囗甜甜゛ 提交于 2019-12-11 01:43:52

问题


I am developing a Java EE application for JBoss 6.1.0 which needs to programmatically store image files on disk.

How/where should I store image files on a JBoss server?


回答1:


You can use the /standalone/data folder for this, whose path is available via the jboss.server.data.dir system property.

File dataDir = new File(System.getProperty("jboss.server.data.dir"));
File yourFile = new File(dataDir, "filename.ext");
// ...

You are even allowed to create subfolders in there. Below example creates /standalone/data/images.

File imagesDir = new File(System.getProperty("jboss.server.data.dir"), "images");
imagesDir.mkdir();
File yourImageFile = new File(imagesDir, "image.png");
// ...

See also:

  • JBoss directory structure
  • JBoss system properties
  • How to save uploaded file in JSF


来源:https://stackoverflow.com/questions/28081916/programmatically-storing-image-files-in-jboss

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!