Class StaticResourceServlet.LocalResource

java.lang.Object
de.businesscode.bcdui.web.servlets.StaticResourceServlet.LocalResource
All Implemented Interfaces:
StaticResourceServlet.Resource
Enclosing class:
StaticResourceServlet

public static class StaticResourceServlet.LocalResource extends Object implements StaticResourceServlet.Resource
This class represents one single resource which is either a file on the file system or a URL from the classpath. Please note that a resource which could not be located results is also represented by a Resource object, but the notFound() method will return true. This is useful, because a not-found resource has also a lookup path so the getPath() method works also in this case.
  • Constructor Details

    • LocalResource

      protected LocalResource(String path, File file, URL url)
      Constructs a resource which is 1) An empty resource if file and url are null, 2) A file resource if file is not null and url is null, 3) A classpath resource if file is null and url is not. The constructor cannot be invoked directly; instead one of the factory methods fetchResource(...) must be used.
      Parameters:
      path - The original path of the resource request. It must not be null.
      file - The reference to the file if this is a file resource. This can be null.
      url - The URL of the classpath resource. This can be null.
  • Method Details