Avodah Zarah 5:2-3
Avodah Zara 5:2
If non-Jewish wine fell on grapes (on the vine), they may be rinsed and they are permitted; if the grapes were split open, then they are prohibited. If the non-Jewish wine fell on figs or dates, then if there was a volume of wine sufficient to impart flavor, they are prohibited. Baisos ben Zonin once transported dried figs on a ship; a barrel of non-Jewish wine broke and spilled on them. He asked the Sages, who permitted the figs. The general principle is that if something imparts flavor that is beneficial, then the item in question is prohibited; if something imparts flavor that is detrimental, it is permitted. An example of the latter is vinegar that fell on ground beans.
Avodah Zara 5:3
Let’s say that a non-Jew was transporting barrels of wine from one place to another with a Jew. If it can be presumed that he was working under supervision, then the wine is permitted. If the Jew told the non-Jew that he was leaving and he stayed away for enough time that a barrel could opened, sealed and wiped down (then the wine is prohibited); Rabban Shimon ben Gamliel says it is prohibited only if the Jew is away long enough for a barrel to be opened, its stopper replaced, and its clay seal to dry.