Revert "Added trim support"

This reverts commit e6207cc95d6cca472e8fedb2e20185d2049dd0be.
Replaced File instance with FileInterface
Revert "Revert "Added trim support""

This reverts commit 5ee8160476186965f54a1fce668c23080788a94c.