ContentDownloadHandler getContentDownloadHandler(List<ID> ids, ContentDownloadContext context);
The following are methods for ContentDownloadHandlerFactory.
public Sfc.ContentDownloadHandler getContentDownloadHandler(List<Id> var1, Sfc.ContentDownloadContext var2)
This example creates a class that implements the Sfc.ContentDownloadHandlerFactory interface and returns a download handler that blocks downloading content to mobile devices.
// Allow customization of the content Download experience public class ContentDownloadHandlerFactoryImpl implements Sfc.ContentDownloadHandlerFactory { public Sfc.ContentDownloadHandler getContentDownloadHandler(Id id, Sfc.ContentDownloadContext context) { Sfc.ContentDownloadHandler contentDownloadHandler = new Sfc.ContentDownloadHandler(); if(context == Sfc.ContentDownloadContext.MOBILE) { contentDownloadHandler.isDownloadAllowed = false; contentDownloadHandler.downloadErrorMessage = 'Downloading a file from a mobile device isn't allowed.'; return contentDownloadHandler; } contentDownloadHandler.isDownloadAllowed = true; return contentDownloadHandler; } }