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

com.sdklite.sphere.hybrid.JavaScriptResponse Maven / Gradle / Ivy

package com.sdklite.sphere.hybrid;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * The {@link JavaScriptResponse} represent a javascript resource
 *
 * @author johnsonlee
 * @since 1.0.0
 */
public class JavaScriptResponse extends MimeTypeResponse {

    public JavaScriptResponse(final String data) {
        this(new ByteArrayInputStream(data.getBytes()));
    }

    public JavaScriptResponse(final File file)
            throws FileNotFoundException {
        this(new FileInputStream(file));
    }

    public JavaScriptResponse(final FileDescriptor fd) {
        this(new FileInputStream(fd));
    }

    public JavaScriptResponse(final InputStream data) {
        super(JAVASCRIPT, "UTF-8", data);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy