public class FileShareSystem extends java.lang.Object implements IMessageListener, FileReceiver.FileReceiverDelegate
Constructor and Description |
---|
FileShareSystem(java.lang.String deviceID,
java.io.File localCacheDirectory)
Instantiates a new file share system.
|
Modifier and Type | Method and Description |
---|---|
void |
errorReceivingFile(MD5Hash hash)
Error receiving file.
|
void |
messageReceived(Message message)
Message received.
|
void |
newFileAddedToCache(LocalFileCacheEntry entry)
New file added to cache.
|
MD5Hash |
registerContent(java.io.File localFile)
Register content.
|
void |
retrieveContent(MD5Hash contentID,
FileShareSystemContentRegistrationDelegate delegate,
long timeoutMillis)
Retrieve content.
|
public FileShareSystem(java.lang.String deviceID, java.io.File localCacheDirectory)
deviceID
- the device idlocalCacheDirectory
- the local cache directorypublic void errorReceivingFile(MD5Hash hash)
FileReceiver.FileReceiverDelegate
errorReceivingFile
in interface FileReceiver.FileReceiverDelegate
hash
- the hashpublic void messageReceived(Message message)
IMessageListener
messageReceived
in interface IMessageListener
message
- the messagepublic void newFileAddedToCache(LocalFileCacheEntry entry)
FileReceiver.FileReceiverDelegate
newFileAddedToCache
in interface FileReceiver.FileReceiverDelegate
entry
- the entrypublic MD5Hash registerContent(java.io.File localFile) throws java.io.FileNotFoundException, java.io.IOException
localFile
- the local filejava.io.FileNotFoundException
- the file not found exceptionjava.io.IOException
- Signals that an I/O exception has occurred.public void retrieveContent(MD5Hash contentID, FileShareSystemContentRegistrationDelegate delegate, long timeoutMillis) throws java.io.IOException
contentID
- the content iddelegate
- the delegatetimeoutMillis
- the timeout millisjava.io.IOException
- Signals that an I/O exception has occurred.