Download raw data in Play 2.0+

I am creating an application for the Play platform and I need to download some data. The structure (I worked with it when it was in 1.2.4, and now I tested 2.0.3), used to support the creation of a data.yaml file that can be loaded at runtime.

Support for this seems to have been removed. What is the best practice for this?

+6
source share
1 answer

No, it was not reset, just reorganized. The main weight was transferred to the Global object and its onStart() method.

Using it, you can perform general operations with the database, as well as load and move any YAML file. Check out the Zentasks sample to find out how to use it in your application (especially: app/Global.java , conf/initial-data.yml ); e.g. from sample :

 Map<String,List<Object>> all = (Map<String,List<Object>>)Yaml.load("initial-data.yml"); 

It is just beginning! Using a Global object up to your imagination!

+7
source

Source: https://habr.com/ru/post/923152/


All Articles