This is actually a Canadian folk song about a privateer from Nova Scotia preying on American merchant ships in the War of 1812. Barrett was obviously an Irishman, however. A privateer was a private enterprise war ship that obtained letters of marque and reprisal from a country at war, and then went out and captured the other side's ships and goods. Our U. S. Constitution speaks of Letters of Marque and Reprisal.
A treaty in Paris in 1856 banned the practice, and now it would be just pure piracy and treated as such.