<s> """<STR_LIT>""" <EOL> from dfvfs . lib import definitions <EOL> from dfvfs . lib import errors <EOL> from dfvfs . path import compressed_stream_path_spec <EOL> from dfvfs . vfs import compressed_stream_file_entry <EOL> from dfvfs . vfs import root_only_file_system <EOL> class CompressedStreamFileSystem ( root_only_file_system . RootOnlyFileSystem ) : <EOL> """<STR_LIT>""" <EOL> TYPE_INDICATOR = definitions . TYPE_INDICATOR_COMPRESSED_STREAM <EOL> def __init__ ( self , resolver_context ) : <EOL> """<STR_LIT>""" <EOL> super ( CompressedStreamFileSystem , self ) . __init__ ( resolver_context ) <EOL> self . _compression_method = None <EOL> def _Close ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _compression_method = None <EOL> def _Open ( self , path_spec , mode = '<STR_LIT:rb>' ) : <EOL> """<STR_LIT>""" <EOL> if not path_spec . HasParent ( ) : <EOL> raise errors . PathSpecError ( <EOL> u'<STR_LIT>' ) <EOL> compression_method = getattr ( path_spec , u'<STR_LIT>' , None ) <EOL> if not compression_method : <EOL> raise errors . PathSpecError ( <EOL> u'<STR_LIT>' ) <EOL> self . _compression_method = compression_method <EOL> def GetFileEntryByPathSpec ( self , path_spec ) : <EOL> """<STR_LIT>""" <EOL> return compressed_stream_file_entry . CompressedStreamFileEntry ( <EOL> self . _resolver_context , self , path_spec , is_root = True , is_virtual = True ) <EOL> def GetRootFileEntry ( self ) : <EOL> """<STR_LIT>""" <EOL> path_spec = compressed_stream_path_spec . CompressedStreamPathSpec ( <EOL> compression_method = self . _compression_method , <EOL> parent = self . _path_spec . parent ) <EOL> return self . GetFileEntryByPathSpec ( path_spec ) </s>
