Example usage for org.apache.wicket.util.file File inputStream

List of usage examples for org.apache.wicket.util.file File inputStream

Introduction

In this page you can find the example usage for org.apache.wicket.util.file File inputStream.

Prototype

public InputStream inputStream() throws FileNotFoundException 

Source Link

Usage

From source file:org.artifactory.webapp.wicket.resource.LogoResource.java

License:Open Source License

@Override
protected byte[] getImageData(Attributes attributes) {
    InputStream inputStream = null;
    try {//from www . ja v a2 s .  c  o  m
        File file = new File(artifactoryHome.getLogoDir(), "logo");
        inputStream = file.inputStream();
        return IOUtils.toByteArray(inputStream);
    } catch (IOException e) {
        throw new RuntimeException("Can't read image file", e);
    } finally {
        IOUtils.closeQuietly(inputStream);
    }
}