@staticmethod
def _get_tarfile_size(component):
    """Enables accurate reporting of the Content-Length header when uploading a VM/vApp component

        :param component: The name of the VM/vApp component
        :type component: String
        """
    if hasattr(component, 'size'):
        size = component.size
    else:
        size = component.seek(0, 2)
        component.seek(0, 0)
    return size
