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

com.sap.cloud.lm.sl.cf.persistence.model.FileInfo Maven / Gradle / Ivy

There is a newer version: 1.106.2
Show newest version
package com.sap.cloud.lm.sl.cf.persistence.model;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.math.BigInteger;

import com.sap.cloud.lm.sl.cf.persistence.services.FileStorageException;

public class FileInfo {
    private final BigInteger size;
    private final String digest;
    private final String digestAlgorithm;
    private final File file;

    public FileInfo(File file, BigInteger size, String digest, String digestAlgorithm) {
        super();
        this.file = file;
        this.size = size;
        this.digest = digest;
        this.digestAlgorithm = digestAlgorithm;
    }

    public BigInteger getSize() {
        return size;
    }

    public String getDigest() {
        return digest;
    }

    public String getDigestAlgorithm() {
        return digestAlgorithm;
    }

    public InputStream getInputStream() throws FileStorageException {
        try {
            return new FileInputStream(file);
        } catch (FileNotFoundException e) {
            throw new FileStorageException(e);
        }
    }

    public File getFile() {
        return file;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy