|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.common.distribute.NetarkivetMessage dk.netarkivet.archive.distribute.ArchiveMessage dk.netarkivet.archive.bitarchive.distribute.GetFileMessage
public class GetFileMessage
Message requesting a file from a bitarchive. Messages is forwarded through arcrepository, but reponds directly to sender.
Field Summary |
---|
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage |
---|
replyOfId |
Constructor Summary | |
---|---|
GetFileMessage(ChannelID to,
ChannelID replyTo,
java.lang.String arcfileName,
java.lang.String replicaId)
Constructor for get file message. |
Method Summary | |
---|---|
void |
accept(ArchiveMessageVisitor v)
Should be implemented as a part of the visitor pattern. |
void |
clearBuffer()
Clear content buffer. |
java.lang.String |
getArcfileName()
Get name of the file to retrieve. |
void |
getData(java.io.File toFile)
Writes the the content of the retrieved file into a local file. |
java.lang.String |
getReplicaId()
Retrieve the replica id. |
void |
setFile(java.io.File data)
Set the file this message should return. |
java.lang.String |
toString()
Retrieval of a string representation of this instance. |
Methods inherited from class dk.netarkivet.common.distribute.NetarkivetMessage |
---|
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GetFileMessage(ChannelID to, ChannelID replyTo, java.lang.String arcfileName, java.lang.String replicaId)
to
- RecipientreplyTo
- Original senderarcfileName
- The file to retrievereplicaId
- The bitarchive replica id to retrieve it from.Method Detail |
---|
public void setFile(java.io.File data)
data
- Content of the file to retrievepublic void getData(java.io.File toFile) throws ArgumentNotValid, IOFailure
toFile
- where to write the content
IOFailure
- on error reading the remote file
or writing the local file
ArgumentNotValid
- If the file is null.public java.lang.String getReplicaId()
public java.lang.String getArcfileName()
public void clearBuffer()
public void accept(ArchiveMessageVisitor v)
accept
in class ArchiveMessage
v
- A message visitorArchiveMessageVisitor
public java.lang.String toString()
toString
in class NetarkivetMessage
NetarkivetMessage.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |