Sha256: 3fa84a26fac0f79eb70b472dc6fd94fe919f7af80208322f561aa356237d0573

Contents?: true

Size: 1.11 KB

Versions: 120

Compression:

Stored size: 1.11 KB

Contents

# encoding: UTF-8

# --
# Copyright (C) 2008-2011 10gen Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ++

module Mongo
  class GridIO

    # This fixes a comparson issue in JRuby 1.9
    def get_md5
      md5_command            = BSON::OrderedHash.new
      md5_command['filemd5'] = @files_id
      md5_command['root']    = @fs_name
      @server_md5 = @files.db.command(md5_command)['md5']
      if @safe
        @client_md5 = @local_md5.hexdigest
        if @local_md5.to_s != @server_md5.to_s
          raise GridMD5Failure, "File on server failed MD5 check"
        end
      else
        @server_md5
      end
    end
  end
end

Version data entries

120 entries across 74 versions & 6 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/mongo-1.6.2/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.5 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.4 vendor/bundle/gems/mongo-1.6.2/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.4 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.3 vendor/bundle/gems/mongo-1.6.2/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.3 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.2 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.2 vendor/bundle/gems/mongo-1.6.2/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.1 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.1 vendor/bundle/gems/mongo-1.6.2/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.0 vendor/bundle/gems/mongo-1.6.2/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.7.0 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.6.9 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.6.9 vendor/bundle/gems/mongo-1.6.2/lib/mongo/gridfs/grid_io_fix.rb
mongo-1.7.1 lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.6.8 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.6.8 vendor/bundle/gems/mongo-1.6.2/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.6.7 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.6.7 vendor/bundle/gems/mongo-1.6.2/lib/mongo/gridfs/grid_io_fix.rb
classiccms-0.6.6 vendor/bundle/gems/mongo-1.6.1/lib/mongo/gridfs/grid_io_fix.rb