I didn't understand your needs completely from your description and as such I'm not exactly sure the producer-consumer
pattern ideally fits your needs. If this does not sound right, please come back to clarify.
Anyway, this pattern can be rather easily implemented in
Java by using one of the synchronized queues in the
java.util.concurrent package, such as
ArrayBlockingQueue. All the hard synchronizing work is already implemented in these queue classes. You'll create one of these (read their javadoc and choose the one that fits your needs best). Then let producer threads put work items into that queue and consumer threads retrieve and process these items. This design ensures that only one consumer will start processing the work item (probably a file in your case) and therefore you don't need to further coordinate worker threads not to compete for work on a single file.
The queue could be part of a singleton, so that all threads share the same instance (this is naturally very important). Googling up
singleton design pattern brings up many materials on this; try some of them, as conceptually singleton pattern belongs to the easier ones.