Read a locked file?

I’m trying to implement drag and drop audio from the sequencer of the DAW to my plugin, and the issue I’m having in Ableton specifically is that sometimes the file is locked. Annoyingly, if I take a midi file and then freeze/flatten to get the wav, the file is still locked and I need to Reverse then Unreverse it to get the “unlocked” version to drag into my plugin.

Is there any way I can get this to work? FileInputStream fails, and I can’t seem to make a copy of the file using File.makeCopyOf.

Any advice appreciated, it would be a big win for the UX of my app if I could figure this out.