Section 103. If a sheriff or other officer impresses or takes up any houses, stores, lodging or other necessaries, or impresses men, the town where such persons or property are so impressed shall pay a just compensation to the persons entitled thereto. Compensation for taking or impressing property may be recovered under chapter seventy-nine.