|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlbg.protocol.data.GridData
lbg.protocol.data.FTPGridData
public class FTPGridData
Keep info to find a file that lies on an FTP
Field Summary |
---|
Fields inherited from class lbg.protocol.data.GridData |
---|
client_hostname, HASHING_ALGORITHM, id, size |
Constructor Summary | |
---|---|
FTPGridData(java.lang.String id,
long size,
java.lang.String host,
int port,
java.lang.String path,
java.lang.String user,
java.lang.String password,
byte[] checksum)
Makes a new FTPGridData. |
Method Summary | |
---|---|
byte[] |
getChecksum()
Get checksum from data. |
java.io.InputStream |
getInputStream()
Get an input stream to read the data |
void |
setLocalParameters(java.lang.String hostname,
int port)
|
void |
toFile(java.io.File file)
Save data in a file. |
Methods inherited from class lbg.protocol.data.GridData |
---|
compareTo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FTPGridData(java.lang.String id, long size, java.lang.String host, int port, java.lang.String path, java.lang.String user, java.lang.String password, byte[] checksum) throws GridException
id
- The unique ID for the file. It should be of the form
requestingpeerID.userID.filename
path
- Absolute path for data on the FTP serverhost
- The host where data lies.port
- The port on the FTP server.user
- Login on FTP server.password
- Associated password to user.checksum
- Checksum of the given data
GridException
- if parameters are invalid.Method Detail |
---|
public void setLocalParameters(java.lang.String hostname, int port) throws GridException
GridException
public void toFile(java.io.File file) throws GridException
FTP transfer is in passive mode, you don't need to worry about ports to open.
toFile
in class GridData
file
- The file where to put data
GridException
public byte[] getChecksum() throws GridException
GridData
getChecksum
in class GridData
GridException
GridData.HASHING_ALGORITHM
public java.io.InputStream getInputStream() throws GridException
GridData
getInputStream
in class GridData
GridException
- If the file doesn't exist
|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.