Project

General

Profile

Revision a2effde9

IDa2effde9184fbeb7f3dd6b8a1c70a84cc7f9ea58
Parent e834dd85
Child 922939ec

Added by Andreas Müller over 3 years ago

cleanup

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/MediaUtils.java
158 158

  
159 159
        Map<Media, MediaRepresentation> returnMediaList;
160 160
        if(mediaList != null){
161
            returnMediaList = new LinkedHashMap<Media, MediaRepresentation>(mediaList.size());
161
            returnMediaList = new LinkedHashMap<>(mediaList.size());
162 162
            for(Media media : mediaList){
163 163

  
164
                Set<MediaRepresentation> candidateRepresentations = new LinkedHashSet<MediaRepresentation>();
164
                Set<MediaRepresentation> candidateRepresentations = new LinkedHashSet<>();
165 165
                candidateRepresentations.addAll(media.getRepresentations());
166 166

  
167 167
                SortedMap<Integer, MediaRepresentation> prefRepresentations
......
181 181
            }
182 182
        }
183 183
        else{
184
            returnMediaList = new HashMap<Media, MediaRepresentation>();
184
            returnMediaList = new HashMap<>();
185 185
        }
186 186
        return returnMediaList;
187 187
    }
......
246 246
     *
247 247
     *
248 248
     */
249
    private static SortedMap<Integer, MediaRepresentation> filterAndOrderMediaRepresentations(Set<MediaRepresentation> mediaRepresentations,
249
    private static SortedMap<Integer, MediaRepresentation> filterAndOrderMediaRepresentations(
250
            Set<MediaRepresentation> mediaRepresentations,
250 251
            Class<? extends MediaRepresentationPart> representationPartType, String[] mimeTypeRegexes,
251 252
            Integer size, Integer widthOrDuration, Integer height) {
252 253

  
253
        SortedMap<Integer, MediaRepresentation> prefRepr = new TreeMap<Integer, MediaRepresentation>();
254
        SortedMap<Integer, MediaRepresentation> prefRepr = new TreeMap<>();
254 255

  
255 256

  
256 257
        size = (size == null ? new Integer(0) : size );
......
264 265
            int representationCnt = 0;
265 266
            for (MediaRepresentation representation : mediaRepresentations) {
266 267

  
267
                List<MediaRepresentationPart> matchingParts = new ArrayList<MediaRepresentationPart>();
268
                List<MediaRepresentationPart> matchingParts = new ArrayList<>();
268 269

  
269 270

  
270 271
                // check MIME type
271
                boolean mimeTypeOK = representation.getMimeType() == null || mimeTypePattern.matcher(representation.getMimeType()).matches();
272
                boolean mimeTypeOK = representation.getMimeType() == null
273
                        || mimeTypePattern.matcher(representation.getMimeType()).matches();
272 274
                logger.debug("mimeTypeOK: " + Boolean.valueOf(mimeTypeOK).toString());
273 275

  
274 276
                int dwa = 0;
......
278 280
                for (MediaRepresentationPart part : representation.getParts()) {
279 281

  
280 282
                    // check representationPartType
281
                    boolean representationPartTypeOK = representationPartType == null || part.getClass().isAssignableFrom(representationPartType);
283
                    boolean representationPartTypeOK = representationPartType == null
284
                            || part.getClass().isAssignableFrom(representationPartType);
282 285
                    logger.debug("representationPartTypeOK: " + Boolean.valueOf(representationPartTypeOK).toString());
283 286

  
284 287
                    if ( !(representationPartTypeOK && mimeTypeOK) ) {
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonPortalController.java
34 34
import org.springframework.web.servlet.ModelAndView;
35 35

  
36 36
import eu.etaxonomy.cdm.api.service.IClassificationService;
37
import eu.etaxonomy.cdm.api.service.IDescriptionService;
38 37
import eu.etaxonomy.cdm.api.service.INameService;
39 38
import eu.etaxonomy.cdm.api.service.ITaxonService;
40 39
import eu.etaxonomy.cdm.api.service.ITermService;
......
97 96
    private INameService nameService;
98 97

  
99 98
    @Autowired
100
    private IDescriptionService descriptionService;
101

  
102
    @Autowired
103 99
    private IClassificationService classificationService;
104 100

  
105 101
    @Autowired
......
606 602
        Map<Media, MediaRepresentation> mediaRepresentationMap = MediaUtils.findPreferredMedia(
607 603
                taxonGalleryMedia, type, mimeTypes, null, widthOrDuration, height, size);
608 604

  
609
        List<Media> filteredMedia = new ArrayList<Media>(mediaRepresentationMap.size());
605
        List<Media> filteredMedia = new ArrayList<>(mediaRepresentationMap.size());
610 606
        for (Media media : mediaRepresentationMap.keySet()) {
611 607
            media.getRepresentations().clear();
612 608
            media.addRepresentation(mediaRepresentationMap.get(media));

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)