def initialize uri_or_fp, start_offset=nil, usual=true, archived=false, id=nil, labels=nil
@mutex = Mutex.new
@labels = Set.new((labels || []) - LabelManager::RESERVED_LABELS)
case uri_or_fp
when String
uri = URI(Source.expand_filesystem_uri(uri_or_fp))
raise ArgumentError, "not an mbox uri" unless uri.scheme == "mbox"
raise ArgumentError, "mbox URI ('#{uri}') cannot have a host: #{uri.host}" if uri.host
raise ArgumentError, "mbox URI must have a path component" unless uri.path
@f = File.open uri.path, 'rb'
@path = uri.path
else
@f = uri_or_fp
@path = uri_or_fp.path
end
start_offset ||= 0
super uri_or_fp, start_offset, usual, archived, id
end