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

org.jboss.resteasy.reactive.client.spi.FieldFiller Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package org.jboss.resteasy.reactive.client.spi;

import java.io.File;
import java.nio.file.Path;

import jakarta.ws.rs.core.GenericType;

import org.jboss.resteasy.reactive.multipart.FileDownload;

public abstract class FieldFiller {

    private final GenericType fieldType;
    private final String partName;
    private final String mediaType;

    protected FieldFiller(GenericType fieldType, String partName, String mediaType) {
        this.fieldType = fieldType;
        this.partName = partName;
        this.mediaType = mediaType;
    }

    public abstract void set(Object responseObject, Object fieldValue);

    public GenericType getFieldType() {
        return fieldType;
    }

    public String getPartName() {
        return partName;
    }

    public String getMediaType() {
        return mediaType;
    }

    @SuppressWarnings("unused") // used in generated classes
    public static File fileDownloadToFile(FileDownload fileDownload) {
        return fileDownload.filePath().toFile();
    }

    @SuppressWarnings("unused") // used in generated classes
    public static Path fileDownloadToPath(FileDownload fileDownload) {
        return fileDownload.filePath();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy