'Validates existence of public file
TODO: validate for private file'

def validate_file(self):

    if (self.file_url or u'').startswith(u'/files/'):
        if (not self.file_name):
            self.file_name = self.file_url.split(u'/files/')[(-1)]
        if (not os.path.exists(get_files_path(frappe.as_unicode(self.file_name.lstrip(u'/'))))):
            frappe.throw(_(u'File    {0}    does    not    exist').format(self.file_url), IOError)
