sentence: the action of 18 october 1806 was a minor naval engagement during the napoleonic wars , fought between the british royal navy frigate caroline and a dutch squadron at the entrance to batavia harbor on java in the dutch east indies .