Class DataStore

Counter 22.2.2003
Homepage http://www.astrosolutions.de
Download Development Pack (56k)
Beispielprogramm ASCII Text-Sharing P2P
java.lang.Object
  |
  +--DataStore

public class DataStore
extends java.lang.Object

This class represents a DataStore that contains files that can be accessed by other clients who are logged on the same server. The upload of files is organized automatically if there are requests over the network.


Constructor Summary
DataStore(java.lang.String server)
           
 
Method Summary
 void delete(java.lang.String file)
           
 boolean download(Result r)
           
 java.lang.String[] getFileNames()
           
 DiskInputStream getInputStream(java.lang.String file)
           
 DiskOutputStream getOutputStream(java.lang.String file)
           
 Result[] search(java.lang.String find)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataStore

public DataStore(java.lang.String server)
Parameters:
String - server The DataStore server to log on. Example: datagram://127.0.0.1 The port numbers are handled automatically. See also documentation of DSServer.
Method Detail

getFileNames

public java.lang.String[] getFileNames()
Returns:
An array containing the filenames in this DataStore

getInputStream

public DiskInputStream getInputStream(java.lang.String file)
Parameters:
String - file The file to open
Returns:
A DiskInputStream to read bytes from the file

getOutputStream

public DiskOutputStream getOutputStream(java.lang.String file)
Parameters:
String - file The file to create or to append bytes
Returns:
A DiskOutputStream to write bytes to the file

delete

public void delete(java.lang.String file)
Parameters:
String - file The file to delete

search

public Result[] search(java.lang.String find)
Parameters:
String - find A search String
Returns:
An array of Results representing filenames available on the network that contain the search String.

download

public boolean download(Result r)
Parameters:
Result - r The search result to download
Returns:
true if the download was successful