public class GetFileMessage extends ArchiveMessage
replyOfId
Constructor and Description |
---|
GetFileMessage(ChannelID to,
ChannelID replyTo,
String arcfileName,
String replicaId)
Constructor for get file message.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(ArchiveMessageVisitor v)
Should be implemented as a part of the visitor pattern.
|
void |
clearBuffer()
Clear content buffer.
|
String |
getArcfileName()
Get name of the file to retrieve.
|
void |
getData(File toFile)
Writes the the content of the retrieved file into a local file.
|
String |
getReplicaId()
Retrieve the replica id.
|
void |
setFile(File data)
Set the file this message should return.
|
String |
toString()
Retrieval of a string representation of this instance.
|
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk
public GetFileMessage(ChannelID to, ChannelID replyTo, String arcfileName, String replicaId)
to
- RecipientreplyTo
- Original senderarcfileName
- The file to retrievereplicaId
- The bitarchive replica id to retrieve it from.public void setFile(File data)
data
- Content of the file to retrievepublic void getData(File toFile) throws ArgumentNotValid, IOFailure
toFile
- where to write the contentIOFailure
- on error reading the remote file or writing the local fileArgumentNotValid
- If the file is null.public String getReplicaId()
public String getArcfileName()
public void clearBuffer()
public void accept(ArchiveMessageVisitor v)
accept
in class ArchiveMessage
v
- A message visitorArchiveMessageVisitor
public String toString()
toString
in class NetarkivetMessage
NetarkivetMessage.toString()
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.