@Override public List<File> directDownload(DirectDownloadType request) throws ServiceException { checkStore(); return new DirectDownload(getServiceInfo(), this.store).run(request); }
String name = extractName(info); getFileResources(reader, name, fileId, result); getExtraFiles(reader, result); "Unable to get any data for resourceId=" + resourceId + " and file=" + fileId); checkSizeLimit(result, info); return result;
/** * Check the current download is not exceeding the maxDownloadSize limit (if activated). Throws * a {@link CSWException} in case the limit is exceeded * * @param info */ private void checkSizeLimit(List<File> fileList, CoverageInfo info) { DirectDownloadSettings settings = DirectDownloadSettings.getSettingsFromMetadata(info.getMetadata(), csw); long maxSize = settings != null ? settings.getMaxDownloadSize() : 0; long sizeLimit = maxSize * 1024; if (fileList != null && !fileList.isEmpty() && sizeLimit > 0) { long cumulativeSize = 0; for (File file : fileList) { cumulativeSize += file.length(); } if (cumulativeSize > sizeLimit) { throw new CSWException( LIMIT_MESSAGE + "The limit is " + formatBytes(sizeLimit) + " but the amount of raw data to be downloaded is " + formatBytes(cumulativeSize)); } } }
(GridCoverage2DReader) coverageInfo.getGridCoverageReader(null, GeoTools.getDefaultHints()); String name = DirectDownload.extractName(coverageInfo); if (reader == null) { throw new IllegalArgumentException(