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)


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

def can_range?
  false
end

#dateObject

Date of the offered file, can be nil



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

def date
end

#filenameObject

Filename of the offered file



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

def filename
end

#length=(l) ⇒ Object

Set the amount of data to send for ranged transfers



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

def length=(l)
end

#md5Object

MD5-Sum of the offered file, can be nil



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

def md5
end

#mimeObject

Mime-type of the offered file, can be nil



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

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


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

def read(length=nil)
end

#seek(position) ⇒ Object

Seek in the source for ranged transfers



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

def seek(position)
end

#sizeObject

Size of the offered file



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

def size
end