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

net.kemitix.dependency.digraph.maven.plugin.DefaultFileLoader Maven / Gradle / Ivy

There is a newer version: 0.9.1
Show newest version
package net.kemitix.dependency.digraph.maven.plugin;

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

import javax.inject.Inject;

/**
 * Implementation of {@link FileLoader}.
 *
 * @author pcampbell
 */
class DefaultFileLoader implements FileLoader {

    private final DigraphMojo mojo;

    @Inject
    DefaultFileLoader(final DigraphMojo mojo) {
        this.mojo = mojo;
    }

    @Override
    public InputStream asInputStream(final File file) {
        try {
            return new FileInputStream(file);
        } catch (FileNotFoundException ex) {
            mojo.getLog().error(ex);
        }
        return null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy