All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.proximax.service.repository.FileRepository Maven / Gradle / Ivy

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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy