# Path: gslib/exception.py
# class InvalidUrlError(Exception):
#   """Exception raised when URL is invalid."""
# 
#   def __init__(self, message):
#     Exception.__init__(self, message)
#     self.message = message
# 
#   def __repr__(self):
#     return str(self)
# 
#   def __str__(self):
#     return 'InvalidUrlError: %s' % self.message


import os
import re
import stat
import sys
from gslib.exception import InvalidUrlError
from gslib.utils import system_util
from gslib.utils import text_util
    self.bucket_name = None
    self.object_name = None
    self.generation = None
    provider_match = PROVIDER_REGEX.match(url_string)
    bucket_match = BUCKET_REGEX.match(url_string)
    if provider_match:
      self.scheme = provider_match.group('provider')
    elif bucket_match:
      self.scheme = bucket_match.group('provider')
      self.bucket_name = bucket_match.group('bucket')
    else:
      object_match = OBJECT_REGEX.match(url_string)
      if object_match:
        self.scheme = object_match.group('provider')
        self.bucket_name = object_match.group('bucket')
        self.object_name = object_match.group('object')
        if self.object_name == '.' or self.object_name == '..':
          raise InvalidUrlError('%s is an invalid root-level object name' %
                                self.object_name)
        if self.scheme == 'gs':
          generation_match = GS_GENERATION_REGEX.match(self.object_name)
          if generation_match:
            self.object_name = generation_match.group('object')
            self.generation = generation_match.group('generation')
        elif self.scheme == 's3':
          version_match = S3_VERSION_REGEX.match(self.object_name)
          if version_match:
            self.object_name = version_match.group('object')
            self.generation = version_match.group('version_id')
      else:

# Path: gslib/exception.py
# class InvalidUrlError(Exception):
#   """Exception raised when URL is invalid."""
# 
#   def __init__(self, message):
#     Exception.__init__(self, message)
#     self.message = message
# 
#   def __repr__(self):
#     return str(self)
# 
#   def __str__(self):
#     return 'InvalidUrlError: %s' % self.message


# Path: gslib/storage_url.py
import os
import re
import stat
import sys
from gslib.exception import InvalidUrlError
from gslib.utils import system_util
from gslib.utils import text_util

    self.bucket_name = None
    self.object_name = None
    self.generation = None
    provider_match = PROVIDER_REGEX.match(url_string)
    bucket_match = BUCKET_REGEX.match(url_string)
    if provider_match:
      self.scheme = provider_match.group('provider')
    elif bucket_match:
      self.scheme = bucket_match.group('provider')
      self.bucket_name = bucket_match.group('bucket')
    else:
      object_match = OBJECT_REGEX.match(url_string)
      if object_match:
        self.scheme = object_match.group('provider')
        self.bucket_name = object_match.group('bucket')
        self.object_name = object_match.group('object')
        if self.object_name == '.' or self.object_name == '..':
          raise InvalidUrlError('%s is an invalid root-level object name' %
                                self.object_name)
        if self.scheme == 'gs':
          generation_match = GS_GENERATION_REGEX.match(self.object_name)
          if generation_match:
            self.object_name = generation_match.group('object')
            self.generation = generation_match.group('generation')
        elif self.scheme == 's3':
          version_match = S3_VERSION_REGEX.match(self.object_name)
          if version_match:
            self.object_name = version_match.group('object')
            self.generation = version_match.group('version_id')
      else:

        raise InvalidUrlError(