|
Eclipse Platform Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IFileContentManager
This is the API to define mappings between file names, file extensions and content types, typically used by repository providers in order to determine whether a given file can be treated as text or must be considered binary. Mappings for names and extensions can either be contributed via an extension point or via this interface. For methods that determine the content type for a given file, the following rules apply:
This interface is not intended to be implemented by clients.
Team.getFileContentManager()
Method Summary | |
---|---|
void |
addExtensionMappings(java.lang.String[] extensions,
int[] types)
Map a set of file extensions to a set of content types and save the mapping in the preferences. |
void |
addNameMappings(java.lang.String[] names,
int[] types)
Map a set of file names to a set of content types and save the mappings in the preferences. |
IStringMapping[] |
getDefaultExtensionMappings()
Get all the plugin-contributed mappings from file extensions to content types. |
IStringMapping[] |
getDefaultNameMappings()
Get all the plugin-contributed mappings from file names to content types. |
IStringMapping[] |
getExtensionMappings()
Get all the currently defined mappings from file names to content types. |
IStringMapping[] |
getNameMappings()
Get all the currently defined mappings from file names to content types. |
int |
getType(IStorage storage)
Get the content type for a given instance of IStorage . |
int |
getTypeForExtension(java.lang.String extension)
Get the content type for a given file extension. |
int |
getTypeForName(java.lang.String filename)
Get the content type for a given file name. |
boolean |
isKnownExtension(java.lang.String extension)
Check whether the given file extension is assigned to a specific type in the content type registry. |
boolean |
isKnownFilename(java.lang.String filename)
Check whether the given file name is assigned to a specific type in the content type registry. |
void |
setExtensionMappings(java.lang.String[] extensions,
int[] types)
Map a set of file extensions to a set of content types and save the mapping in the preferences. |
void |
setNameMappings(java.lang.String[] names,
int[] types)
Map a set of file names to a set of content types and save the mappings in the preferences. |
Method Detail |
---|
int getType(IStorage storage)
IStorage
. User-defined mappings
take precedence over plugin-contributed mappings; further, mappings for the entire file name
take precedence over mappings for the file extension only.
storage
- the instance of IStorage
.
Team.UNKNOWN
, Team.TEXT
or Team.BINARY
.boolean isKnownFilename(java.lang.String filename)
filename
- the file name to check for
boolean isKnownExtension(java.lang.String extension)
extension
- the extension to check for
int getTypeForName(java.lang.String filename)
filename
- The file name
Team.UNKNOWN
, Team.TEXT
or Team.BINARY
.int getTypeForExtension(java.lang.String extension)
extension
- The extension
Team.UNKNOWN
, Team.TEXT
or Team.BINARY
.void addNameMappings(java.lang.String[] names, int[] types)
names
- The file namestypes
- The corresponding types, each one being one of
Team.UNKNOWN
,Team.TEXT
or
Team.BINARY
.void addExtensionMappings(java.lang.String[] extensions, int[] types)
extensions
- The extensionstypes
- The corresponding types, each one being one of
Team.UNKNOWN
,Team.TEXT
or
Team.BINARY
.void setNameMappings(java.lang.String[] names, int[] types)
names
- The file namestypes
- The corresponding types, each one being one of
Team.UNKNOWN
,Team.TEXT
or
Team.BINARY
.void setExtensionMappings(java.lang.String[] extensions, int[] types)
extensions
- The extensionstypes
- The corresponding types, each one being one of
Team.UNKNOWN
,Team.TEXT
or
Team.BINARY
.IStringMapping[] getNameMappings()
IStringMapping[] getExtensionMappings()
IStringMapping[] getDefaultNameMappings()
IStringMapping[] getDefaultExtensionMappings()
|
Eclipse Platform Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.