io.proximax.service.repository.FileRepository Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-chain-xipfs-sdk Show documentation
Show all versions of java-chain-xipfs-sdk Show documentation
Official ProximaX P2P Storage SDK Library in Java.
The newest version!
package io.proximax.service.repository;
import io.reactivex.Observable;
import java.io.File;
import java.io.InputStream;
/**
* This interface defines the methods that a file repository must implement
*/
public interface FileRepository {
/**
* Add/Upload a file (represented as byte stream) to storage node
*
* @param byteStream the byte stream to upload
* @return the hash (base58) for the data uploaded
*/
Observable addByteStream(InputStream byteStream);
/**
* Add/Upload a path
*
* @param path the path being added
* @return the hash (base58) for the data uploaded
*/
Observable addPath(File path);
/**
* Retrieves the file stream given a hash
*
* @param dataHash the hash (base58) of an IPFS file
* @return the file (represented as byte stream)
*/
Observable getByteStream(String dataHash);
}