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

org.jglfont.impl.ResourceLoaderImpl Maven / Gradle / Ivy

package org.jglfont.impl;

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

import org.jglfont.spi.ResourceLoader;

public class ResourceLoaderImpl implements ResourceLoader {

  @Override
  public InputStream load(final String filename) {
    InputStream is = Thread.currentThread().getClass().getResourceAsStream("/" + filename);
    if (is == null) {
      File file = new File(filename);
      if (file.exists()) {
        try {
          is = new FileInputStream(file);
        } catch (FileNotFoundException ignore) {
        }
      }
    }
    return is;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy