01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.ide.undo;
11:
12: import java.io.InputStream;
13:
14: import org.eclipse.core.runtime.CoreException;
15:
16: /**
17: * IFileContentDescription is a description of a file's content.
18: *
19: * This class is not intended to be instantiated or used by clients.
20: *
21: * @since 3.3
22: *
23: */
24: public interface IFileContentDescription {
25: /**
26: * Returns an open input stream on the contents of the file described. The
27: * client is responsible for closing the stream when finished.
28: *
29: * @return an input stream containing the contents of the file
30: * @throws CoreException
31: * any CoreException encountered retrieving the contents
32: */
33: public InputStream getContents() throws CoreException;
34:
35: /**
36: * Returns whether this file content description still exists. If it does
37: * not exist, it will be unable to produce the contents.
38: *
39: * @return <code>true</code> if this description exists, and
40: * <code>false</code> if it does not
41: */
42: public boolean exists();
43:
44: /**
45: * Returns the name of a charset encoding to be used when decoding the
46: * contents into characters. Returns <code>null</code> if a charset
47: * has not been explicitly specified.
48: *
49: * @return the name of a charset, or <code>null</code>
50: * @throws CoreException
51: * any CoreException encountered while determining the character
52: * set
53: *
54: */
55: public String getCharset() throws CoreException;
56: }
|