How to write JSON inside of java : <p>i have a JSON string and i want to write it as a JSON file(.json) inside of java. because my final application needs to import .json file not a string. (i am using spring to create a web app)</p>

<p>this is my json string:</p>

<pre><code>String str = "{"polygons": {"landuse": ["__any__"],"building": ["__any__"],"shop": ["__any__"]}}";
</code></pre>

<p>and i want a file (str.json) inside of my java webapp not saving to pc and then importing.</p>

<p>do you have solution for this task? </p>

<p>thanks </p>
