Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.core.runtime.content
Interface IContentTypeMatcher

All Known Subinterfaces:
IContentTypeManager

public interface IContentTypeMatcher

An object that performs content type matching queries.

This interface is not intended to be implemented by clients.

Since:
3.1
See Also:
IContentTypeManager.getMatcher(IContentTypeManager.ISelectionPolicy, IScopeContext)

Method Summary
  IContentType findContentTypeFor ( InputStream contents, String fileName)
          Returns the preferred content type for the given contents and file name.
  IContentType findContentTypeFor ( String fileName)
          Returns the preferred content type for the given file name.
  IContentType[] findContentTypesFor ( InputStream contents, String fileName)
          Returns the content types associated to the given contents and file name.
  IContentType[] findContentTypesFor ( String fileName)
          Returns all content types known by the platform that are associated to the given file name.
  IContentDescription getDescriptionFor ( InputStream contents, String fileName, QualifiedName[] options)
          Tries to obtain a description for the given contents and file name.
  IContentDescription getDescriptionFor ( Reader contents, String fileName, QualifiedName[] options)
          Tries to obtain a description for the given contents and file name.
 

Method Detail

findContentTypeFor

IContentType findContentTypeFor(
InputStream contents,
                                
String fileName)
                                throws 
IOException
Returns the preferred content type for the given contents and file name.

Returns null if no associated content types are found.

If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.

Any IOExceptions that may occur while reading the given input stream will flow to the caller. The input stream will not be closed by this operation.

Parameters:
contents - an input stream
fileName - the file name associated to the contents, or null
Returns:
the preferred content type associated to the given file name, or null
Throws:
IOException - if an error occurs while reading the contents

findContentTypeFor

IContentType findContentTypeFor(
String fileName)
Returns the preferred content type for the given file name. If multiple content types are associated with the given file name, the one considered the most appropriated will be returned. If there are no content types associated, null is returned.

Parameters:
fileName - the name of the file
Returns:
the preferred content type associated to the given file name, or null

findContentTypesFor

IContentType[] findContentTypesFor(
InputStream contents,
                                   
String fileName)
                                   throws 
IOException
Returns the content types associated to the given contents and file name.

Returns an empty array if no associated content types are found.

If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.

Any IOExceptions that may occur while reading the given input stream will flow to the caller. The input stream will not be closed by this operation.

Parameters:
contents - an input stream
fileName - the file name associated to the contents, or null
Returns:
all content types associated to the given contents and file name
Throws:
IOException - if an error occurs while reading the contents

findContentTypesFor

IContentType[] findContentTypesFor(
String fileName)
Returns all content types known by the platform that are associated to the given file name.

Returns an empty array if there are no content types associated.

Parameters:
fileName - the name of the file
Returns:
all content types associated to the given file spec

getDescriptionFor

IContentDescription getDescriptionFor(
InputStream contents,
                                      
String fileName,
                                      
QualifiedName[] options)
                                      throws 
IOException
Tries to obtain a description for the given contents and file name.

Any IOExceptions that may occur while reading the given input stream will flow to the caller. The input stream will not be closed by this operation.

If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.

Parameters:
contents - the contents to be interpreted
fileName - the file name associated to the contents, or null
options - an array of keys for all properties that should be described, or IContentDescription.ALL, for all of them
Returns:
a content description if one could be obtained, or null
Throws:
IOException - if an error occurs while reading the contents
See Also:
IContentDescription

getDescriptionFor

IContentDescription getDescriptionFor(
Reader contents,
                                      
String fileName,
                                      
QualifiedName[] options)
                                      throws 
IOException
Tries to obtain a description for the given contents and file name.

Any IOExceptions that may occur while reading the given input stream will flow to the caller. The reader will not be closed by this operation.

If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.

Parameters:
contents - the contents to be interpreted
fileName - the file name associated to the contents, or null
options - an array of keys for all properties that should be described, or IContentDescription.ALL, for all of them
Returns:
a content description if one could be obtained, or null
Throws:
IOException - if an error occurs while reading the contents
See Also:
IContentDescription

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire