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

io.quarkus.qe.tcp.FileResource Maven / Gradle / Ivy

There is a newer version: 1.6.0.Beta17
Show newest version
package io.quarkus.qe.tcp;

import java.io.IOException;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/file")
public class FileResource {

    @GET
    @Path("/custom/text.txt")
    @Produces(MediaType.TEXT_PLAIN)
    public String text() throws IOException {
        return new String(FileResource.class.getResourceAsStream("/custom/text.txt").readAllBytes());
    }

    @GET
    @Path("/custom.cc")
    @Produces(MediaType.TEXT_PLAIN)
    public String cc() throws IOException {
        return new String(FileResource.class.getResourceAsStream("/custom.cc").readAllBytes());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy