On a first ever visit to Swansea University, Barry never looked in danger of dropping points, staying top of the Cymru South and keeping a clean sheet.
The visitors took a seventh minute lead, with Warman crossing from the right, Cotterill controlling the ball in the middle and Kayne McLaggon firing home.
Barry doubled their advantage after 22 minutes, Warman again crossing from the right, and McLaggon ghosting past the defence to score a tap-in.
McLaggon had a first half penalty saved by the Swansea Uni keeper, but scored his hat-trick from the spot midway through the second half after Barry were awarded a second spot-kick.
Mike Lewis was generally untroubled in the Barry goal, keeping a clean sheet as Barry finished a second successive matchday on top of the Cymru South table.