ymsg.network.event
Class SessionFileTransferEvent
Object
EventObject
SessionEvent
SessionFileTransferEvent
- All Implemented Interfaces:
- Serializable
- public class SessionFileTransferEvent
- extends SessionEvent
Represents an incoming file transfer event. To transfer files from one
client to another, Yahoo employs two methods. The first uploads the file
to a scratch area on a dedicated Yahoo server, using HTTP, and the informs
the target client of the location to download the file from. The second
is a direct peer-to-peer transfer.
jYMSG currently only supports the first, indirect, method.
There are four fields of importance here: the first is from
,
which details who sent the file; the second is message
, which
details an accompanying message to display; the third is timestamp
which documents when the uploaded file will expire (typically a week from
the upload time) and the final one is location
, which gives
the URL to fetch the file from.
Note: The Session
class contains two methods for easily
downloading files referenced by these events: saveFileTransferAs
and saveFileTransferTo
.
  |
getTo |
getFrom |
getMessage |
getTimestamp |
getLocation |
fileTransferReceived |
y |
y |
y |
y |
y |
- Since:
- 1.0
- See Also:
- Serialized Form
Fields inherited from class EventObject |
source |
Constructor Summary |
SessionFileTransferEvent(Object o,
String t,
String f,
String m,
String dt,
String l)
Create a new instance. |
Method Summary |
URL |
getLocation()
Returns the location of the file which was uploaded to Yahoo. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class EventObject |
getSource |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SessionFileTransferEvent
public SessionFileTransferEvent(Object o,
String t,
String f,
String m,
String dt,
String l)
- Create a new instance. API users should not call this directly.
The API itself will create its own events.
- Parameters:
o
- source of event (Session
)t
- to (Yahoo id)f
- from (Yahoo id)m
- message (ASCII or UTF-8)dt
- timestamp (seconds since epoch)l
- location (URL)
getLocation
public URL getLocation()
- Returns the location of the file which was uploaded to Yahoo. To
successfully complete the file transfer, the client should make a
connection to this location and download its contents.
- Returns:
- the URL of the transfered file.
toString
public String toString()
- Returns a string representation of this object.
- Overrides:
toString
in class SessionEvent
- Returns:
- object as a string
- Since:
- 1.0