@@ -336,9 +336,8 @@ def add_datastream(options = {})
336336 file = query_options . delete ( :content )
337337 content_type = query_options . delete ( :content_type ) || query_options [ :mimeType ] || file_content_type ( file )
338338 run_hook :before_add_datastream , :pid => pid , :dsid => dsid , :file => file , :options => options
339- str = file . respond_to? ( :read ) ? file . read : file
340339 file . rewind if file . respond_to? ( :rewind )
341- ProfileParser . parse_datastream_profile ( client [ datastream_url ( pid , dsid , query_options ) ] . post ( str , :content_type => content_type . to_s , :multipart => true ) )
340+ ProfileParser . parse_datastream_profile ( client [ datastream_url ( pid , dsid , query_options ) ] . post ( file , :content_type => content_type . to_s , :multipart => true ) )
342341 rescue Exception => exception
343342 rescue_with_handler ( exception ) || raise
344343 end
@@ -361,9 +360,8 @@ def modify_datastream(options = {})
361360 end
362361
363362 run_hook :before_modify_datastream , :pid => pid , :dsid => dsid , :file => file , :content_type => content_type , :options => options
364- str = file . respond_to? ( :read ) ? file . read : file
365363 file . rewind if file . respond_to? ( :rewind )
366- ProfileParser . parse_datastream_profile ( client [ datastream_url ( pid , dsid , query_options ) ] . put ( str , rest_client_options ) )
364+ ProfileParser . parse_datastream_profile ( client [ datastream_url ( pid , dsid , query_options ) ] . put ( file , rest_client_options ) )
367365
368366 rescue Exception => exception
369367 rescue_with_handler ( exception ) || raise
0 commit comments