Create method for get contents from file