public class IPFS
extends java.lang.Object
Constructor and Description |
---|
IPFS() |
IPFS(java.lang.String host,
int port,
boolean ssl)
Creates an IPFS instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
add(byte[] content)
Add byte array to IPFS
|
java.lang.String |
add(java.lang.String path)
Add file to IPFS.
|
static java.lang.String |
fromHex(java.lang.String hexString)
Encode hex string with Base58 algorithm.
|
byte[] |
get(java.lang.String encodedHash)
Get file from IPFS.
|
void |
setIPFSNode(java.lang.String host,
int port,
boolean ssl)
Set a IPFS node.
|
static java.lang.String |
toHex(java.lang.String encodedHash)
Decode encoded multi hash string with Base58 and add hex prefix(0x).
|
public IPFS()
public IPFS(java.lang.String host, int port, boolean ssl)
host
- The host url.port
- The port number to use.ssl
- either using ssl or not.public static java.lang.String toHex(java.lang.String encodedHash)
encodedHash
- A encoded string with Base58.public static java.lang.String fromHex(java.lang.String hexString)
hexString
- A hex string to encode.public java.lang.String add(java.lang.String path) throws java.io.IOException
path
- A file path to add at IPFS.java.io.IOException
public java.lang.String add(byte[] content) throws java.io.IOException
content
- A byte array to add at IPFSjava.io.IOException
public byte[] get(java.lang.String encodedHash) throws java.io.IOException
encodedHash
- A encoded multi hash string with base58.java.io.IOException
public void setIPFSNode(java.lang.String host, int port, boolean ssl)
host
- The host url.port
- The port number to use.ssl
- either using ssl or not.