|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectj_waste.network.Packet
j_waste.network.HeadedPacket
j_waste.network.FileRequestPacket
This class represents the FileRequestPacket used in file transfers.
| Field Summary |
| Fields inherited from class j_waste.network.HeadedPacket |
iscomplete, packetData, padBytes |
| Fields inherited from class j_waste.network.Packet |
packet |
| Constructor Summary | |
FileRequestPacket()
Constructs a new FileRequestPacket. |
|
FileRequestPacket(byte[] pkg)
Alternative constructor. |
|
FileRequestPacket(byte[] guid,
java.lang.String DEBUG_ONLY_CONSTRUCTOR_DONT_USE)
debug constructor, should be removed if not used anymore |
|
| Method Summary | |
void |
finalizePacket()
Finalizes the packet. |
int |
getAbort()
Returns the abort flag of this packet. |
byte[] |
getFileGUID()
Returns the file GUID of this packet. |
int |
getFileIndex()
Returns the file index of this packet. |
byte[] |
getFilenameHash()
Returns the filename hash of this packet. |
java.net.InetAddress |
getIP()
Returns the IP number. |
int |
getNextChunk()
Returns the number of the next chunk requested. |
int |
getNumberOfChunks()
Returns the number of chunks requested. |
byte[] |
getOldGUID()
Returns the old GUID of this packet. |
int |
getPort()
Returns the port number. |
java.lang.String |
getSender()
Returns the sender of this packet. |
void |
setAbort(int abort)
Sets the abort flag of this packet. |
void |
setFileGUID(byte[] fileGuid)
Sets the file GUID of this packet. |
void |
setFileIndex(int fileIndex)
Sets the file index of this packet. |
void |
setFilenameHash(byte[] filenameHash)
Sets the filename hash of this packet. |
void |
setIP(java.net.InetAddress ip)
Sets the IP number. |
void |
setNextChunk(int nextChunk)
Sets the number of the next chunk requested. |
void |
setNumberOfChunks(int numChunks)
Sets the number of chunks requested. |
void |
setOldGUID(byte[] oldGuid)
Sets the old GUID of this packet. |
void |
setPort(short port)
Sets the port. |
void |
setSender(java.lang.String sender)
Sets the sender of this packet. |
byte[] |
toByteArray()
Returns a byte array representation of the packet. |
| Methods inherited from class j_waste.network.HeadedPacket |
createPacket, getData, getGeneralType, getGUID, getHeader, getIntPrio, getIntType, getLength, getMD5, getPrio, getTTL, getType, setLength, setTTL |
| Methods inherited from class j_waste.network.Packet |
padCD, reverseBytes, reverseInt, reverseShort, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FileRequestPacket()
public FileRequestPacket(byte[] pkg)
throws InvalidPacketException
pkg - an existing byte array representation of the packet.
InvalidPacketException - on error.
public FileRequestPacket(byte[] guid,
java.lang.String DEBUG_ONLY_CONSTRUCTOR_DONT_USE)
throws InvalidPacketException
| Method Detail |
public void setFileGUID(byte[] fileGuid)
fileGuid - a byte array containing the guid of this packet.public byte[] getFileGUID()
public void setOldGUID(byte[] oldGuid)
oldGuid - a byte array containing the old guid of this packet.public byte[] getOldGUID()
public void setAbort(int abort)
abort - An integer representing the abort status of this packet. Can have the values NO_ABORT, ABORT ot PREMATURE_ABORT.public int getAbort()
public void setFileIndex(int fileIndex)
fileIndex - The file index of this packet.public int getFileIndex()
public void setFilenameHash(byte[] filenameHash)
filenameHash - a 20 byte SHA-1 hash of the filename.public byte[] getFilenameHash()
public void setSender(java.lang.String sender)
sender - A string containing the nickname of the sender of the packet.public java.lang.String getSender()
public void setIP(java.net.InetAddress ip)
ip - The IP number.public java.net.InetAddress getIP()
public void setPort(short port)
port - The port.public int getPort()
public void setNextChunk(int nextChunk)
nextChunk - The number of the next chunk requested.public int getNextChunk()
public void setNumberOfChunks(int numChunks)
numChunks - The number of chunks requested.public int getNumberOfChunks()
public byte[] toByteArray()
toByteArray in class HeadedPacketpublic void finalizePacket()
finalizePacket in class HeadedPacket
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||