001/*
002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 * $Id: MimetypeEntry.java 20676 2007-06-17 15:28:28Z sfermigier $
020 */
021package org.nuxeo.ecm.platform.mimetype.interfaces;
022
023import java.io.Serializable;
024import java.util.List;
025
026/**
027 * MimetypeEntry entry.
028 * <p>
029 * Holds meta information about a mimetype.
030 *
031 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a>
032 * @author <a href="mailto:lgodard@nuxeo.com">Laurent Godard</a>
033 */
034public interface MimetypeEntry extends Serializable {
035
036    /**
037     * Returns the mimetype's names.
038     *
039     * @return list of strings containing the mimetype names
040     */
041    List<String> getMimetypes();
042
043    /**
044     * Returns the main RFC-2046 name for this mime type.
045     * <p>
046     * If this mime type has several names ('text/restructured', 'text-x-rst'), then this method will always return the
047     * first form.
048     *
049     * @return the main RFC-2046 name for this mime type
050     */
051    String getNormalized();
052
053    /**
054     * Returns the major part of the RFC-2046.
055     *
056     * @see #getNormalized()
057     * @return the major part of the RFC-2046 name of this mime type.
058     */
059    String getMajor();
060
061    /**
062     * Returns the minor part of the RFC-2046.
063     *
064     * @see #getNormalized()
065     * @return string
066     */
067    String getMinor();
068
069    /**
070     * Returns the path of the icon for this mimetype.
071     *
072     * @return String
073     */
074    String getIconPath();
075
076    /**
077     * Returns the list of extensions for this mimetype.
078     *
079     * @return list of strings that contain different mimetypes
080     */
081    List<String> getExtensions();
082
083    /**
084     * Is this a binary mimetype?
085     * <p>
086     * Might be useful to know if we can read it as human.
087     *
088     * @return boolean
089     */
090    boolean isBinary();
091
092    /**
093     * Is this mimetype supported by a LiveEdit plugin?
094     * <p>
095     * Might be useful to know to display the Edit online link.
096     *
097     * @return boolean
098     */
099    boolean isOnlineEditable();
100
101    /**
102     * Is this mimetype supported by a oleExtract plugin?
103     * <p>
104     * If the property is true, processes the ole Extraction, otherwise skip.
105     *
106     * @return boolean
107     */
108    boolean isOleSupported();
109
110}