I'm writing a batch with Spring Batch.
The reader will read all .eml files in a certain directory and for each element read i call EmailConverter.emlToEmail(InputStream) method.
The last file converted into Email using this method is locked by the process. I dont know if 'm doing something wrong or if it can be a bug.
org.springframework.core.io.Resource = .....
Email email = EmailConverter.emlToEmail(resource.getInputStream());
After doing this. for every last element converted (every time i launch the batch) it will be locked until processor and writer are executing. After the end of the process the lock on the .eml file on the disk will be released.
A screenshot of Resource Monitor (Windows built-in) that show the lock on the file after the call to EmailConverter.emlToEmail(InputStream):

Sorry for my bad English, hope someone of you can help me understand if I'm doing something wrong or if I encountered a bug.
Thank you guys 😃
I'm writing a batch with Spring Batch.
The reader will read all .eml files in a certain directory and for each element read i call EmailConverter.emlToEmail(InputStream) method.
The last file converted into Email using this method is locked by the process. I dont know if 'm doing something wrong or if it can be a bug.
After doing this. for every last element converted (every time i launch the batch) it will be locked until processor and writer are executing. After the end of the process the lock on the .eml file on the disk will be released.
A screenshot of Resource Monitor (Windows built-in) that show the lock on the file after the call to EmailConverter.emlToEmail(InputStream):
Sorry for my bad English, hope someone of you can help me understand if I'm doing something wrong or if I encountered a bug.
Thank you guys 😃