private <T extends ExtRepositoryObjectAdapter<?>> List<T> _filterByMimeType( List<T> extRepositoryObjects, String[] mimeTypes) { if (ArrayUtil.isEmpty(mimeTypes)) { return extRepositoryObjects; } Set<String> allowedMimeTypes = new HashSet<>(Arrays.asList(mimeTypes)); List<T> filteredExtRepositoryObjects = new ArrayList<>(); for (T extRepositoryObject : extRepositoryObjects) { if (extRepositoryObject instanceof ExtRepositoryFileEntryAdapter) { ExtRepositoryFileEntryAdapter extRepositoryFileEntryAdapter = (ExtRepositoryFileEntryAdapter) extRepositoryObject; if (allowedMimeTypes.contains(extRepositoryFileEntryAdapter.getMimeType())) { filteredExtRepositoryObjects.add(extRepositoryObject); } } } return filteredExtRepositoryObjects; }
private void _checkAssetEntry(ExtRepositoryFileEntryAdapter extRepositoryFileEntryAdapter) throws PortalException { dlAppHelperLocalService.checkAssetEntry( PrincipalThreadLocal.getUserId(), extRepositoryFileEntryAdapter, extRepositoryFileEntryAdapter.getFileVersion()); }
public List<ExtRepositoryFileVersionAdapter> getExtRepositoryFileVersionAdapters( ExtRepositoryFileEntryAdapter extRepositoryFileEntryAdapter) throws PortalException { List<ExtRepositoryFileVersion> extRepositoryFileVersions = _extRepository.getExtRepositoryFileVersions( extRepositoryFileEntryAdapter.getExtRepositoryModel()); return _toExtRepositoryFileVersionAdapters( extRepositoryFileEntryAdapter, extRepositoryFileVersions); }
public InputStream getContentStream(ExtRepositoryFileEntryAdapter extRepositoryFileEntryAdapter) throws PortalException { return _extRepository.getContentStream(extRepositoryFileEntryAdapter.getExtRepositoryModel()); }
private void _forceGetFileVersions(ExtRepositoryFileEntryAdapter extRepositoryFileEntryAdapter) { extRepositoryFileEntryAdapter.getFileVersions(WorkflowConstants.STATUS_ANY); }