The current implementation will create the Asset link as http://server/api/v2/assets/10/link
In the general case, the backend is quite free to decide what to return (the current and simpler implementation is to return the first file in Asset.location. This is ok in the general case, but in case where the asset data is a directory, the returned file is usually an index file.
When using and index file the client usually splits the URL in BASE_PATH/INDEX_FILE, so that when the index file references a file "XYZ" the client builds the URL BASE_PATH/XYZ
This means that for these Assets the link should have the file explicitly in the URL.
In the AssetHandler we may implement a method to get a link generator handler which returns the specific way to create the link.
The initial implementation may have a simple registering mechanism that can be easily extended or configured in settings.
According to #12226:
The current implementation will create the Asset link as
http://server/api/v2/assets/10/link
In the general case, the backend is quite free to decide what to return (the current and simpler implementation is to return the first file inAsset.location
. This is ok in the general case, but in case where the asset data is a directory, the returned file is usually an index file. When using and index file the client usually splits the URL inBASE_PATH/INDEX_FILE
, so that when the index file references a file "XYZ" the client builds the URLBASE_PATH/XYZ
This means that for these Assets the link should have the file explicitly in the URL.In the AssetHandler we may implement a method to get a link generator handler which returns the specific way to create the link. The initial implementation may have a simple registering mechanism that can be easily extended or configured in settings.