platform35/org.eclipse.core.resources/src/org/eclipse/core/resources/IEncodedStorage.java
changeset 40 eb3c938c7fef
equal deleted inserted replaced
39:2a03ec4dbf31 40:eb3c938c7fef
       
     1 /*******************************************************************************
       
     2  *  Copyright (c) 2004, 2009 IBM Corporation and others.
       
     3  *  All rights reserved. This program and the accompanying materials
       
     4  *  are made available under the terms of the Eclipse Public License v1.0
       
     5  *  which accompanies this distribution, and is available at
       
     6  *  http://www.eclipse.org/legal/epl-v10.html
       
     7  * 
       
     8  *  Contributors:
       
     9  *     IBM Corporation - initial API and implementation
       
    10  *******************************************************************************/
       
    11 package org.eclipse.core.resources;
       
    12 
       
    13 import org.eclipse.core.runtime.CoreException;
       
    14 
       
    15 /**
       
    16  * A storage that knows how its contents are encoded.
       
    17  * 
       
    18  * <p>The <code>IEncodedStorage</code> interface extends <code>IStorage</code>
       
    19  * in order to provide access to the charset to be used when decoding its 
       
    20  * contents. 
       
    21  * </p><p>
       
    22  * Clients may implement this interface.
       
    23  * </p>
       
    24  * 
       
    25  * @since 3.0
       
    26  */
       
    27 public interface IEncodedStorage extends IStorage {
       
    28 	/**
       
    29 	 * Returns the name of a charset encoding to be used when decoding this 
       
    30 	 * storage's contents into characters. Returns <code>null</code> if a proper 
       
    31 	 * encoding cannot be determined.
       
    32 	 * <p>
       
    33 	 * Note that this method does not check whether the result is a supported
       
    34 	 * charset name. Callers should be prepared to handle 
       
    35 	 * <code>UnsupportedEncodingException</code> where this charset is used. 
       
    36 	 * </p>
       
    37 	 *
       
    38 	 * @return the name of a charset, or <code>null</code>
       
    39 	 * @exception CoreException if an error happens while determining 
       
    40 	 * the charset. See any refinements for more information.
       
    41 	 * @see IStorage#getContents()
       
    42 	 */
       
    43 	public String getCharset() throws CoreException;
       
    44 }