@Test public void testGetMaxContentSizeLimit() { long expected = 52428800; final AssetDownloadHelper assetDownloadHelper = ctx.getService(AssetDownloadHelper.class); assertEquals(expected, assetDownloadHelper.getMaxContentSizeLimit()); }
@Override public long getMaxContentSizeLimit() { try { final Dictionary<String, Object> osgiConfigurationProperties = getAssetDownloadServletProperties(); if (osgiConfigurationProperties != null) { return PropertiesUtil.toLong(osgiConfigurationProperties.get(MAX_SIZE_PROPERTY), DEFAULT_SIZE_LIMIT); } else{ log.debug("No OSGi configuration properties could be found for service.pid [ {} ]", ASSET_DOWNLOAD_SERVLET_PID); } } catch (IOException | InvalidSyntaxException e) { log.error("Could not get max content size property for AEM's Asset Download Servlet", e); } return DEFAULT_SIZE_LIMIT; }
AssetDownloadHelperImpl implements AssetDownloadHelper { @Override public long getMaxContentSizeLimit() { try { final Dictionary<String, Object> osgiConfigurationProperties = getAssetDownloadServletProperties(); if (osgiConfigurationProperties != null) { return PropertiesUtil.toLong(osgiConfigurationProperties.get(MAX_SIZE_PROPERTY), DEFAULT_SIZE_LIMIT); } else{ log.debug("No OSGi configuration properties could be found for service.pid [ {} ]", ASSET_DOWNLOAD_SERVLET_PID); } } catch (IOException | InvalidSyntaxException e) { log.error("Could not get max content size property for AEM's Asset Download Servlet", e); } return DEFAULT_SIZE_LIMIT; } }
AssetDownloadHelperImpl implements AssetDownloadHelper { @Override public long getMaxContentSizeLimit() { try { final Dictionary<String, Object> osgiConfigurationProperties = getAssetDownloadServletProperties(); if (osgiConfigurationProperties != null) { return PropertiesUtil.toLong(osgiConfigurationProperties.get(MAX_SIZE_PROPERTY), DEFAULT_SIZE_LIMIT); } else{ log.debug("No OSGi configuration properties could be found for service.pid [ {} ]", ASSET_DOWNLOAD_SERVLET_PID); } } catch (IOException | InvalidSyntaxException e) { log.error("Could not get max content size property for AEM's Asset Download Servlet", e); } return DEFAULT_SIZE_LIMIT; }  }
AssetDownloadHelperImpl implements AssetDownloadHelper { @Override public long getMaxContentSizeLimit() { try { final Dictionary<String, Object> osgiConfigurationProperties = getAssetDownloadServletProperties(); if (osgiConfigurationProperties != null) { return PropertiesUtil.toLong(osgiConfigurationProperties.get(MAX_SIZE_PROPERTY), DEFAULT_SIZE_LIMIT); } else{ log.debug("No OSGi configuration properties could be found for service.pid [ {} ]", ASSET_DOWNLOAD_SERVLET_PID); } } catch (IOException | InvalidSyntaxException e) { log.error("Could not get max content size property for AEM's Asset Download Servlet", e); } return DEFAULT_SIZE_LIMIT; }  @Override long getMaxContentSizeLimit(); @Override long getAssetDownloadSize(Collection<AssetModel> assets, Resource configResource); }
AssetDownloadHelperImpl implements AssetDownloadHelper { @Override public long getMaxContentSizeLimit() { try { final Dictionary<String, Object> osgiConfigurationProperties = getAssetDownloadServletProperties(); if (osgiConfigurationProperties != null) { return PropertiesUtil.toLong(osgiConfigurationProperties.get(MAX_SIZE_PROPERTY), DEFAULT_SIZE_LIMIT); } else{ log.debug("No OSGi configuration properties could be found for service.pid [ {} ]", ASSET_DOWNLOAD_SERVLET_PID); } } catch (IOException | InvalidSyntaxException e) { log.error("Could not get max content size property for AEM's Asset Download Servlet", e); } return DEFAULT_SIZE_LIMIT; }  @Override long getMaxContentSizeLimit(); @Override long getAssetDownloadSize(Collection<AssetModel> assets, Resource configResource);  }