Module: Jabber::FileTransfer::TransferSource

Included in:
FileSource
Defined in:
lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb

Overview

The TransferSource is an interface (Mix-in) which sources for FileTransfer#offer should include

Instance Method Summary collapse

Instance Method Details

#can_range?Boolean

Does implement the methods seek and length= ?

FileTransfer will only then offer a ranged transfer.

result
false

or [true]

Returns:

  • (Boolean)


58
59
60
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb', line 58

def can_range?
  false
end

#dateObject

Date of the offered file, can be nil



35
36
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb', line 35

def date
end

#filenameObject

Filename of the offered file



19
20
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb', line 19

def filename
end

#length=(l) ⇒ Object

Set the amount of data to send for ranged transfers



51
52
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb', line 51

def length=(l)
end

#md5Object

MD5-Sum of the offered file, can be nil



31
32
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb', line 31

def md5
end

#mimeObject

Mime-type of the offered file, can be nil



23
24
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb', line 23

def mime
end

#read(length = nil) ⇒ Object

Read a chunk from the source

If this is a ranged transfer, it should implement length checking

length
Fixnum


43
44
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb', line 43

def read(length=nil)
end

#seek(position) ⇒ Object

Seek in the source for ranged transfers



47
48
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb', line 47

def seek(position)
end

#sizeObject

Size of the offered file



27
28
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb', line 27

def size
end