java - The process cannot access the file because it is being used by another process

后端 未结 4 1353
生来不讨喜
生来不讨喜 2021-02-14 00:24

I have a piece of code that monitors a directory for addition of files. Whenever a new file is added to the directory, the contents of the file are picked and published on kafka

4条回答
  •  囚心锁ツ
    2021-02-14 01:18

    You have to close all the connection which is accessing that file before deleting it.

提交回复
热议问题