juzu.plugin.asset

## Class AssetController

- java.lang.Object
- - juzu.plugin.asset.AssetController

-     public class AssetController
      extends Object

  The asset controller.
  Author:
    Julien Viet

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AssetController()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `byId(String id)` Generate an asset URL from the specified id.
    `String` | `byPath(AssetLocation location, String uri)` Returns the URL of an asset.
    `String` | `byPath(String path)` Returns the URL of an asset located in the assets package of the application.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AssetController

          public AssetController()

  - ### Method Detail

    - #### byId

          public String byId(String id)
                      throws NullPointerException

      Generate an asset URL from the specified id.
      Parameters:
        `id` - the asset id
      Returns:
        null if the asset id does not exists
      Throws:
        `NullPointerException` - if the asset id is null

    - #### byPath

          public String byPath(String path)
                        throws NullPointerException

      Returns the URL of an asset located in the assets package of the application.

      If the controller is not under the scope of a request, null is returned.

      Parameters:
        `path` - the path
      Returns:
        the asset url
      Throws:
        `NullPointerException` - when the path argument is null

    - #### byPath

          public String byPath(AssetLocation location,
                      String uri)
                        throws NullPointerException

      Returns the URL of an asset.

      If the controller is not under the scope of a request, null is returned.

      Parameters:
        `location` - the asset location
        `uri` - the asset uri
      Returns:
        the asset url
      Throws:
        `NullPointerException` - when the path argument is null

Copyright © 2014 eXo Platform SAS. All rights reserved.