Ignore:
Timestamp:
2015-03-10T01:17:39+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #11162 - update to metadata-extractor 2.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/drew/metadata/Metadata.java

    r6127 r8132  
    11/*
    2  * Copyright 2002-2012 Drew Noakes
     2 * Copyright 2002-2015 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    1616 * More information about this project is available at:
    1717 *
    18  *    http://drewnoakes.com/code/exif/
    19  *    http://code.google.com/p/metadata-extractor/
     18 *    https://drewnoakes.com/code/exif/
     19 *    https://github.com/drewnoakes/metadata-extractor
    2020 */
    2121package com.drew.metadata;
     
    2424import com.drew.lang.annotations.Nullable;
    2525
    26 import java.util.ArrayList;
    27 import java.util.Collection;
    28 import java.util.HashMap;
    29 import java.util.Map;
     26import java.util.*;
    3027
    3128/**
    32  * A top-level object to hold the various types of metadata (Exif/IPTC/etc) related to one entity (such as a file
    33  * or stream).
    34  * <p/>
    35  * Metadata objects may contain zero or more directories.  Each directory may contain zero or more tags with
    36  * corresponding values.
     29 * A top-level object that holds the metadata values extracted from an image.
     30 * <p>
     31 * Metadata objects may contain zero or more {@link Directory} objects.  Each directory may contain zero or more tags
     32 * with corresponding values.
    3733 *
    38  * @author Drew Noakes http://drewnoakes.com
     34 * @author Drew Noakes https://drewnoakes.com
    3935 */
    4036public final class Metadata
     
    4238    @NotNull
    4339    private final Map<Class<? extends Directory>,Directory> _directoryByClass = new HashMap<Class<? extends Directory>, Directory>();
    44    
     40
    4541    /**
    4642     * List of Directory objects set against this object.  Keeping a list handy makes
     
    5854    public Iterable<Directory> getDirectories()
    5955    {
    60         return _directoryList;
     56        return Collections.unmodifiableCollection(_directoryList);
    6157    }
    6258
     
    7268
    7369    /**
    74      * Returns a <code>Directory</code> of specified type.  If this <code>Metadata</code> object already contains
     70     * Returns a {@link Directory} of specified type.  If this {@link Metadata} object already contains
    7571     * such a directory, it is returned.  Otherwise a new instance of this directory will be created and stored within
    76      * this Metadata object.
     72     * this {@link Metadata} object.
    7773     *
    7874     * @param type the type of the Directory implementation required.
     
    104100
    105101    /**
    106      * If this <code>Metadata</code> object contains a <code>Directory</code> of the specified type, it is returned.
     102     * If this {@link Metadata} object contains a {@link Directory} of the specified type, it is returned.
    107103     * Otherwise <code>null</code> is returned.
    108104     *
    109105     * @param type the Directory type
    110106     * @param <T> the Directory type
    111      * @return a Directory of type T if it exists in this Metadata object, otherwise <code>null</code>.
     107     * @return a Directory of type T if it exists in this {@link Metadata} object, otherwise <code>null</code>.
    112108     */
    113109    @Nullable
     
    123119    /**
    124120     * Indicates whether a given directory type has been created in this metadata
    125      * repository.  Directories are created by calling <code>getOrCreateDirectory(Class)</code>.
     121     * repository.  Directories are created by calling {@link Metadata#getOrCreateDirectory(Class)}.
    126122     *
    127      * @param type the Directory type
    128      * @return true if the metadata directory has been created
     123     * @param type the {@link Directory} type
     124     * @return true if the {@link Directory} has been created
    129125     */
    130126    public boolean containsDirectory(Class<? extends Directory> type)
     
    135131    /**
    136132     * Indicates whether any errors were reported during the reading of metadata values.
    137      * This value will be true if Directory.hasErrors() is true for one of the contained Directory objects.
     133     * This value will be true if Directory.hasErrors() is true for one of the contained {@link Directory} objects.
    138134     *
    139135     * @return whether one of the contained directories has an error
     
    147143        return false;
    148144    }
     145
     146    @Override
     147    public String toString()
     148    {
     149        return String.format("Metadata (%d %s)",
     150            _directoryList.size(),
     151            _directoryList.size() == 1
     152                ? "directory"
     153                : "directories");
     154    }
    149155}
Note: See TracChangeset for help on using the changeset viewer.