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

com.lacunasoftware.restpkicore.DocumentFile Maven / Gradle / Ivy

There is a newer version: 1.1.4
Show newest version
package com.lacunasoftware.restpkicore;

import java.io.InputStream;

/**
 * DocumentFile
 */
public class DocumentFile {

    private final RestPkiService service;
    private DocumentFileModel model;

    public String getName() {
        return model.getName();
    }

    public long getLength() {
        return model.getLength();
    }

    public String getContentType() {
        return model.getContentType();
    }

    public String getLocation() {
        return model.getLocation();
    }

    public boolean canRead() {
        return (model.getLocation() != null);
    }

    public DocumentFile(RestPkiService service, DocumentFileModel model) {
        this.service = service;
        this.model = model;
    }

    public InputStream openRead() throws Exception {
        return service.openRead(getLocation());
    }

    public byte[] getContent() throws Exception {
        return service.getContent(getLocation());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy