Oh, wait wait wait.  I think we can stick with this index business, but use JavaFileManager.inferBinaryName.