# 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
  """Cloud URL class providing parsing and convenience methods.

    This class assists with usage and manipulation of an
    (optionally wildcarded) cloud URL string.  Depending on the string
    contents, this class represents a provider, bucket(s), or object(s).

    This class operates only on strings.  No cloud storage API calls are
    made from this class.
  """

  def __init__(self, url_string):
    self.scheme = None
    self.delim = '/'
    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 == '..':

# 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

  """Cloud URL class providing parsing and convenience methods.

    This class assists with usage and manipulation of an
    (optionally wildcarded) cloud URL string.  Depending on the string
    contents, this class represents a provider, bucket(s), or object(s).

    This class operates only on strings.  No cloud storage API calls are
    made from this class.
  """

  def __init__(self, url_string):
    self.scheme = None
    self.delim = '/'
    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' %