Method: Aspose::Cloud::Cells::Workbook#decrypt_password

Defined in:
lib/Cells/workbook.rb

#decrypt_password(password) ⇒ Object



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/Cells/workbook.rb', line 354

def decrypt_password password
  begin
    if @filename == ''
      raise 'Base file name not specified'
    end
    fields_array = Hash.new
    fields_array['Password'] = password
    json_data = fields_array.to_json
    str_uri = $product_uri + '/cells/' + @filename + '/encryption'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.delete(signed_uri,json_data,:accept => 'application/json')
    json = JSON.parse(response)
    if json['Code']==200
      return true
    else
      return false
    end
  rescue Exception=>e
    print e
  end
end