Module: Jabber::FileTransfer::TransferSource

Included in:
FileSource
Defined in:
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)


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

def can_range?
  false
end

#dateObject

Date of the offered file, can be nil



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

def date
end

#filenameObject

Filename of the offered file



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

def filename
end

#length=(l) ⇒ Object

Set the amount of data to send for ranged transfers



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

def length=(l)
end

#md5Object

MD5-Sum of the offered file, can be nil



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

def md5
end

#mimeObject

Mime-type of the offered file, can be nil



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

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


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

def read(length=nil)
end

#seek(position) ⇒ Object

Seek in the source for ranged transfers



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

def seek(position)
end

#sizeObject

Size of the offered file



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

def size
end