$14 GRAYBYTE WORDPRESS FILE MANAGER $62

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/ruby18/lib64/ruby/1.8/soap/

HOME
Current File : /opt/alt/ruby18/lib64/ruby/1.8/soap//attachment.rb
# soap/attachment.rb: SOAP4R - SwA implementation.
# Copyright (C) 2002, 2003  Jamie Herre and NAKAMURA, Hiroshi <[email protected]>.

# This program is copyrighted free software by NAKAMURA, Hiroshi.  You can
# redistribute it and/or modify it under the same terms of Ruby's license;
# either the dual license version in 2003, or any later version.


require 'soap/baseData'
require 'soap/mapping'


module SOAP


class SOAPAttachment < SOAPExternalReference
  attr_reader :data

  def initialize(value)
    super()
    @data = value
  end

private

  def external_contentid
    @data.contentid
  end
end


class Attachment
  attr_reader :io
  attr_accessor :contenttype

  def initialize(string_or_readable = nil)
    @string_or_readable = string_or_readable
    @contenttype = "application/octet-stream"
    @contentid = nil
  end

  def contentid
    @contentid ||= Attachment.contentid(self)
  end

  def contentid=(contentid)
    @contentid = contentid
  end

  def mime_contentid
    '<' + contentid + '>'
  end

  def content
    if @content == nil and @string_or_readable != nil
      @content = @string_or_readable.respond_to?(:read) ?
	@string_or_readable.read : @string_or_readable
    end
    @content
  end

  def to_s
    content
  end

  def write(out)
    out.write(content)
  end

  def save(filename)
    File.open(filename, "wb") do |f|
      write(f)
    end
  end

  def self.contentid(obj)
    # this needs to be fixed
    [obj.__id__.to_s, Process.pid.to_s].join('.')
  end

  def self.mime_contentid(obj)
    '<' + contentid(obj) + '>'
  end
end


module Mapping
  class AttachmentFactory < SOAP::Mapping::Factory
    def obj2soap(soap_class, obj, info, map)
      soap_obj = soap_class.new(obj)
      mark_marshalled_obj(obj, soap_obj)
      soap_obj
    end

    def soap2obj(obj_class, node, info, map)
      obj = node.data
      mark_unmarshalled_obj(node, obj)
      return true, obj
    end
  end

  DefaultRegistry.add(::SOAP::Attachment, ::SOAP::SOAPAttachment,
    AttachmentFactory.new, nil)
end


end


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.48 PM
root / root
0755
encodingstyle
--
3 Mar 2024 10.48 PM
root / linksafe
0755
header
--
3 Mar 2024 10.48 PM
root / linksafe
0755
mapping
--
3 Mar 2024 10.48 PM
root / linksafe
0755
rpc
--
3 Mar 2024 10.48 PM
root / linksafe
0755
attachment.rb
1.991 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
baseData.rb
16.73 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
element.rb
5.396 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
generator.rb
6.659 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
httpconfigloader.rb
3.148 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
mapping.rb
0.372 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
marshal.rb
1.499 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
mimemessage.rb
4.937 KB
26 May 2009 12.22 PM
root / linksafe
0644
netHttpClient.rb
4.247 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
parser.rb
6.032 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
processor.rb
1.372 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
property.rb
6.923 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
soap.rb
3.753 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
streamHandler.rb
5.859 KB
12 Feb 2007 11.01 PM
root / linksafe
0644
wsdlDriver.rb
15.755 KB
12 Feb 2007 11.01 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF