Package io.jmix.core

Interface Resources

All Superinterfaces:
org.springframework.core.io.ResourceLoader
All Known Implementing Classes:
ResourcesImpl

public interface Resources extends org.springframework.core.io.ResourceLoader
Central infrastructure interface for loading resources. Searches for a resource according to the following rules:
  • If the given location represents an URL, searches for this URL.
  • If the given location starts from classpath: prefix, searches for a classpath resource.
  • If not an URL, try to find a file below the conf directory using the given location as relative path. If a file found, uses this file.
  • Otherwise searches for a classpath resource for the given location.
  • Field Summary

    Fields inherited from interface org.springframework.core.io.ResourceLoader

    CLASSPATH_URL_PREFIX
  • Method Summary

    Modifier and Type
    Method
    Description
    Searches for a resource according to the rules explained in Resources and returns the resource as stream if found.
    Searches for a resource according to the rules explained in Resources and returns the resource as string if found.

    Methods inherited from interface org.springframework.core.io.ResourceLoader

    getClassLoader, getResource
  • Method Details

    • getResourceAsStream

      @Nullable InputStream getResourceAsStream(String location)
      Searches for a resource according to the rules explained in Resources and returns the resource as stream if found. The returned stream should be closed after use.
      Parameters:
      location - resource location
      Returns:
      InputStream or null if the resource is not found
    • getResourceAsString

      @Nullable String getResourceAsString(String location)
      Searches for a resource according to the rules explained in Resources and returns the resource as string if found.
      Parameters:
      location - resource location
      Returns:
      resource content or null if the resource is not found