def create_file(file_path, contents, options = {})
      # Default values
      options[:root_path] = 'app' if ! options.has_key?(:root_path)
      contents ||= ""

      # Entry point
      url = "#{@client.app_info[:launcher_server]}#{API_VERSION}/nfs/file/#{options[:root_path]}/#{SafeNet.escape(file_path)}"

      # API call
      uri = URI(url)
      http = Net::HTTP.new(uri.host, uri.port)
      headers = {
        'Authorization' => "Bearer #{@client.key_helper.get_valid_token()}",
      }
      headers["Metadata"]       = Base64.strict_encode64(options[:meta]) if options.has_key?(:meta)
      headers["Content-Type"]   = options[:content_type] || 'text/plain'
      headers["Content-Length"] = contents.size.to_s
      req = Net::HTTP::Post.new(uri.path, headers)
      req.body = contents
      res = http.request(req)
      res.code == "200" ? true : JSON.parse(res.body)
    end
def create_file(file_path, contents, options = {})
      # Default values
      options[:root_path] = 'app' if ! options.has_key?(:root_path)
      contents ||= ""

      # Entry point
      url = "#{@client.app_info[:launcher_server]}#{API_VERSION}/nfs/file/#{options[:root_path]}/#{SafeNet.escape(file_path)}"

      # API call
      uri = URI(url)
      http = Net::HTTP.new(uri.host, uri.port)
      headers = {
        'Authorization' => "Bearer #{@client.key_helper.get_valid_token()}",
      }
      headers["Metadata"]       = Base64.strict_encode64(options[:meta]) if options.has_key?(:meta)
      headers["Content-Type"]   = options[:content_type] || 'text/plain'
      headers["Content-Length"] = contents.size.to_s
      req = Net::HTTP::Post.new(uri.path, headers)
      req.body = contents
      res = http.request(req)
      res.code == "200" ? true : JSON.parse(res.body)
    end
Create a file.
 Only authorised requests can invoke the API.

 Usage: my_client.nfs.create_file("/docs/hello.txt", "Hello World!")
 Adv.Usage: my_client.nfs.create_file("/docs/hello.txt", meta: "some meta", root_path: "app", content_type: "text/plain")
 Fail: {"errorCode"=>-505, "description"=>"NfsError::FileAlreadyExistsWithSameName"}
 Success: true

 Reference: https://maidsafe.readme.io/docs/nfsfile