/** * The classloader that all application classes and resources can be loaded from. * * @return the class loader */ public ClassLoader classLoader() { return env.classLoader(); }
/** * Retrieves a file relative to the application root path. * * @param relativePath relative path of the file to fetch * @return a file instance - it is not guaranteed that the file exists */ public File getFile(String relativePath) { return env.getFile(relativePath); }
/** * The root path that the application is deployed at. * * @return the path */ public File rootPath() { return env.rootPath(); }
/** * Retrieves a resource stream from the classpath. * * @param relativePath relative path of the resource to fetch * @return InputStream to the resource (may be null) */ public InputStream resourceAsStream(String relativePath) { return Scala.orNull(env.resourceAsStream(relativePath)); }
/** * The mode of the application. * * @return the mode */ public Mode mode() { return env.mode().asJava(); }
@Override default void configure(play.api.Environment env) { configure(env.asJava()); }
/** * Retrieves a resource from the classpath. * * @param relativePath relative path of the resource to fetch * @return URL to the resource (may be null) */ public URL resource(String relativePath) { return Scala.orNull(env.resource(relativePath)); }
public Environment(File rootPath, ClassLoader classLoader, Mode mode) { this(new play.api.Environment(rootPath, classLoader, mode.asScala())); }
/** * Retrieves a file relative to the application root path. * This method returns an Optional, using empty if the file was not found. * * @param relativePath relative path of the file to fetch * @return an existing file */ public Optional<File> getExistingFile(String relativePath) { return OptionConverters.toJava(env.getExistingFile(relativePath)); }
/** * Retrieves a resource stream from the classpath. * * @param relativePath relative path of the resource to fetch * @return InputStream to the resource (may be null) */ public InputStream resourceAsStream(String relativePath) { return Scala.orNull(env.resourceAsStream(relativePath)); }
/** * The mode of the application. * * @return the mode */ public Mode mode() { return env.mode().asJava(); }
@Override default void configure(play.api.Environment env) { configure(env.asJava()); }
/** * Retrieves a resource from the classpath. * * @param relativePath relative path of the resource to fetch * @return URL to the resource (may be null) */ public URL resource(String relativePath) { return Scala.orNull(env.resource(relativePath)); }
public Environment(File rootPath, ClassLoader classLoader, Mode mode) { this(new play.api.Environment(rootPath, classLoader, mode.asScala())); }
/** * Retrieves a file relative to the application root path. * This method returns an Optional, using empty if the file was not found. * * @param relativePath relative path of the file to fetch * @return an existing file */ public Optional<File> getExistingFile(String relativePath) { return OptionConverters.toJava(env.getExistingFile(relativePath)); }
/** * Retrieves a resource stream from the classpath. * * @param relativePath relative path of the resource to fetch * @return InputStream to the resource (may be null) */ public InputStream resourceAsStream(String relativePath) { return Scala.orNull(env.resourceAsStream(relativePath)); }
/** * The mode of the application. * * @return the mode */ public Mode mode() { return env.mode().asJava(); }
@Override default void configure(play.api.Environment env) { configure(env.asJava()); }
/** * The classloader that all application classes and resources can be loaded from. * * @return the class loader */ public ClassLoader classLoader() { return env.classLoader(); }
/** * The root path that the application is deployed at. */ public File rootPath() { return env.rootPath(); }