def ValidateVfsPath(path):
 components = (path or '').lstrip('/').split('/')
 if (not components):
  raise ValueError(('Empty path is not a valid path: %s.' % utils.SmartStr(path)))
 if (components[0] not in ROOT_FILES_WHITELIST):
  raise ValueError(("First path component was '%s', but has to be one of %s" % (utils.SmartStr(components[0]), ', '.join(ROOT_FILES_WHITELIST))))
 return True

def ValidateVfsPath ( path ) : components = ( path or '' ) . lstrip ( '/' ) . split ( '/' ) if ( not components ) : raise ValueError ( ( 'Empty path is not a valid path: %s.' % utils . SmartStr ( path ) ) ) if ( components [ 0 ] not in ROOT_FILES_WHITELIST ) : raise ValueError ( ( "First path component was '%s', but has to be one of %s" % ( utils . SmartStr ( components [ 0 ] ) , ', ' . join ( ROOT_FILES_WHITELIST ) ) ) ) return True
validates a vfs path .