# Writing and Reading a text file from Elasticsearch Plugin

**URL:** <https://discuss.elastic.co/t/writing-and-reading-a-text-file-from-elasticsearch-plugin/203022>\
**Category:** Elasticsearch\
**Created:** [October 10, 2019, 12:49pm UTC](https://discuss.elastic.co/t/writing-and-reading-a-text-file-from-elasticsearch-plugin/203022 "2019-10-10T12:49:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eeshan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eeshan/32/54472_2.png) [@Eeshan](https://discuss.elastic.co/u/Eeshan)\
**Post date:** [October 10, 2019, 12:49pm UTC](https://discuss.elastic.co/t/writing-and-reading-a-text-file-from-elasticsearch-plugin/203022/1 "2019-10-10T12:49:45Z")

</div>

Hi,

I am working on a plugin, which generates meta-data from indexed documents. During the generation of this meta-data, I want to store some temporary data in a file and again read that file in future. The output of the plugin is very different from the content of the file.

I have tried giving permission `permission java.io.FilePermission "D:\\Projects\\accuracy_file.txt","write";` in `java-security.policy` file and I am still getting this error `access denied ("java.io.FilePermission" "D:\Projects\accuracy_file.txt" "write")`. The file has to be generated because it may also be used by some other (not ES) services.

Please help me figure out a way out.  
Thanks in advance  
E.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 7, 2019, 12:49pm UTC](https://discuss.elastic.co/t/writing-and-reading-a-text-file-from-elasticsearch-plugin/203022/2 "2019-11-07T12:49:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
