Class AssetsBundle

    • Constructor Detail

      • AssetsBundle

        public AssetsBundle()
        Creates a new AssetsBundle which serves up static assets from src/main/resources/assets/* as /assets/*.
        See Also:
        AssetsBundle(String, String, String)
      • AssetsBundle

        public AssetsBundle​(String path)
        Creates a new AssetsBundle which will configure the application to serve the static files located in src/main/resources/${path} as /${path}. For example, given a path of "/assets", src/main/resources/assets/example.js would be served up from /assets/example.js.
        Parameters:
        path - the classpath and URI root of the static asset files
        See Also:
        AssetsBundle(String, String, String)
      • AssetsBundle

        public AssetsBundle​(String resourcePath,
                            String uriPath)
        Creates a new AssetsBundle which will configure the application to serve the static files located in src/main/resources/${resourcePath} as /${uriPath}. For example, given a resourcePath of "/assets" and a uriPath of "/js", src/main/resources/assets/example.js would be served up from /js/example.js.
        Parameters:
        resourcePath - the resource path (in the classpath) of the static asset files
        uriPath - the uri path for the static asset files
        See Also:
        AssetsBundle(String, String, String)
      • AssetsBundle

        public AssetsBundle​(String resourcePath,
                            String uriPath,
                            String indexFile)
        Creates a new AssetsBundle which will configure the application to serve the static files located in src/main/resources/${resourcePath} as /${uriPath}. If no file name is in ${uriPath}, ${indexFile} is appended before serving. For example, given a resourcePath of "/assets" and a uriPath of "/js", src/main/resources/assets/example.js would be served up from /js/example.js.
        Parameters:
        resourcePath - the resource path (in the classpath) of the static asset files
        uriPath - the uri path for the static asset files
        indexFile - the name of the index file to use
      • AssetsBundle

        public AssetsBundle​(String resourcePath,
                            String uriPath,
                            String indexFile,
                            String assetsName)
        Creates a new AssetsBundle which will configure the application to serve the static files located in src/main/resources/${resourcePath} as /${uriPath}. If no file name is in ${uriPath}, ${indexFile} is appended before serving. For example, given a resourcePath of "/assets" and a uriPath of "/js", src/main/resources/assets/example.js would be served up from /js/example.js.
        Parameters:
        resourcePath - the resource path (in the classpath) of the static asset files
        uriPath - the uri path for the static asset files
        indexFile - the name of the index file to use
        assetsName - the name of servlet mapping used for this assets bundle
      • AssetsBundle

        public AssetsBundle​(String resourcePath,
                            String uriPath,
                            String indexFile,
                            String assetsName,
                            String defaultMediaType)
        Creates a new AssetsBundle which will configure the application to serve the static files located in src/main/resources/${resourcePath} as /${uriPath}. If no file name is in ${uriPath}, ${indexFile} is appended before serving. For example, given a resourcePath of "/assets" and a uriPath of "/js", src/main/resources/assets/example.js would be served up from /js/example.js.
        Parameters:
        resourcePath - the resource path (in the classpath) of the static asset files
        uriPath - the uri path for the static asset files
        indexFile - the name of the index file to use
        assetsName - the name of servlet mapping used for this assets bundle
        defaultMediaType - the default media type for unknown file extensions
        Since:
        2.0