Class IPFSProxyConnector
java.lang.Object
wrappers.IPFSProxyConnector
REST API Wrapper for the IPFS Cluster Proxy. Works with Kubo as well, but needs to be used with the cluster in order for the backups to be replicated. See IPFS Cluster Proxy Docs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(InputStream file) Adds a file to IPFS.addBlock(InputStream block) Puts a block on to IPFS.Retrieves the block with the given CID See block/getbyte[]Gets a file with the specified CID and returns the pure bytes See getgetID()voidvoidRemoves a block based on the given CID See block/rm
-
Constructor Details
-
IPFSProxyConnector
-
-
Method Details
-
addBlock
Puts a block on to IPFS. See Kubo Block Put- Parameters:
block- The bytes to put- Returns:
- The CID
- Throws:
IOException- is thrown if the http request failsNullPointerExceptionIPFSException
-
add
Adds a file to IPFS. See add- Parameters:
file- The file to add- Returns:
- The CID of the newly uploaded File
- Throws:
IOException- for issues with the http requestNullPointerException- if the response body is nullIPFSException- if the request fails
-
publish
- Throws:
IOExceptionIPFSException
-
getBlock
Retrieves the block with the given CID See block/get- Parameters:
CID- The CID of the block to get- Returns:
- The bytes of the block (Still encrypted)
- Throws:
IOException- is thrown when the http request failsNullPointerExceptionIPFSException
-
getFile
Gets a file with the specified CID and returns the pure bytes See get- Parameters:
CID- The CID of the File- Returns:
- The file as bytes
- Throws:
IOExceptionNullPointerExceptionIPFSException
-
getID
- Throws:
IOExceptionIPFSException
-
rmBlock
Removes a block based on the given CID See block/rm- Parameters:
CID- the CID of the block to remove- Throws:
IOException- is thrown if an error with the Response occursIPFSException
-