コード例 #1
0
  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;
  }
コード例 #2
0
  private void _checkAssetEntry(ExtRepositoryFileEntryAdapter extRepositoryFileEntryAdapter)
      throws PortalException {

    dlAppHelperLocalService.checkAssetEntry(
        PrincipalThreadLocal.getUserId(),
        extRepositoryFileEntryAdapter,
        extRepositoryFileEntryAdapter.getFileVersion());
  }
コード例 #3
0
  public List<ExtRepositoryFileVersionAdapter> getExtRepositoryFileVersionAdapters(
      ExtRepositoryFileEntryAdapter extRepositoryFileEntryAdapter) throws PortalException {

    List<ExtRepositoryFileVersion> extRepositoryFileVersions =
        _extRepository.getExtRepositoryFileVersions(
            extRepositoryFileEntryAdapter.getExtRepositoryModel());

    return _toExtRepositoryFileVersionAdapters(
        extRepositoryFileEntryAdapter, extRepositoryFileVersions);
  }
コード例 #4
0
  public InputStream getContentStream(ExtRepositoryFileEntryAdapter extRepositoryFileEntryAdapter)
      throws PortalException {

    return _extRepository.getContentStream(extRepositoryFileEntryAdapter.getExtRepositoryModel());
  }
コード例 #5
0
  private void _forceGetFileVersions(ExtRepositoryFileEntryAdapter extRepositoryFileEntryAdapter) {

    extRepositoryFileEntryAdapter.getFileVersions(WorkflowConstants.STATUS_ANY);
  }