Class ProfileStore
- java.lang.Object
-
- org.eclipse.m2m.atl.adt.ui.preferences.ProfileStore
-
public class ProfileStore extends java.lang.Object
Can load/store profiles from/to profilesKey
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ENCODING
The default encoding to useprotected static java.lang.String
VERSION_KEY_SUFFIX
-
Constructor Summary
Constructors Constructor Description ProfileStore(java.lang.String profilesKey)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ProfileManager.Profile>
readProfiles(org.eclipse.core.runtime.preferences.IScopeContext scope)
java.util.List<ProfileManager.Profile>
readProfilesFromFile(java.io.File file)
Read the available profiles from the internal XML file and return them as collection ornull
if the file is not a profile file.static java.util.List<ProfileManager.Profile>
readProfilesFromStream(org.xml.sax.InputSource inputSource)
Load profiles from a XML stream and add them to a map ornull
if the source is not a profile store.java.util.List<ProfileManager.Profile>
readProfilesFromString(java.lang.String profiles)
void
writeProfiles(java.util.Collection<ProfileManager.Profile> profiles, org.eclipse.core.runtime.preferences.IScopeContext instanceScope)
void
writeProfilesToFile(java.util.Collection<ProfileManager.Profile> profiles, java.io.File file, java.lang.String encoding)
Write the available profiles to the internal XML file.static void
writeProfilesToStream(java.util.Collection<ProfileManager.Profile> profiles, java.io.OutputStream stream, java.lang.String encoding)
Save profiles to an XML stream
-
-
-
Field Detail
-
ENCODING
public static final java.lang.String ENCODING
The default encoding to use- See Also:
- Constant Field Values
-
VERSION_KEY_SUFFIX
protected static final java.lang.String VERSION_KEY_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
readProfiles
public java.util.List<ProfileManager.Profile> readProfiles(org.eclipse.core.runtime.preferences.IScopeContext scope) throws org.eclipse.core.runtime.CoreException
- Returns:
- Returns the collection of profiles currently stored in the preference store or
null
if the loading failed. The elements are of typeProfileManager.CustomProfile
and are all updated to the latest version. - Throws:
org.eclipse.core.runtime.CoreException
-
writeProfiles
public void writeProfiles(java.util.Collection<ProfileManager.Profile> profiles, org.eclipse.core.runtime.preferences.IScopeContext instanceScope) throws org.eclipse.core.runtime.CoreException
- Throws:
org.eclipse.core.runtime.CoreException
-
readProfilesFromString
public java.util.List<ProfileManager.Profile> readProfilesFromString(java.lang.String profiles) throws org.eclipse.core.runtime.CoreException
- Throws:
org.eclipse.core.runtime.CoreException
-
readProfilesFromFile
public java.util.List<ProfileManager.Profile> readProfilesFromFile(java.io.File file) throws org.eclipse.core.runtime.CoreException
Read the available profiles from the internal XML file and return them as collection ornull
if the file is not a profile file.- Parameters:
file
- The file to read from- Returns:
- returns a list of
CustomProfile
ornull
- Throws:
org.eclipse.core.runtime.CoreException
-
readProfilesFromStream
public static java.util.List<ProfileManager.Profile> readProfilesFromStream(org.xml.sax.InputSource inputSource) throws org.eclipse.core.runtime.CoreException
Load profiles from a XML stream and add them to a map ornull
if the source is not a profile store.- Parameters:
inputSource
- The input stream- Returns:
- returns a list of
CustomProfile
ornull
- Throws:
org.eclipse.core.runtime.CoreException
-
writeProfilesToFile
public void writeProfilesToFile(java.util.Collection<ProfileManager.Profile> profiles, java.io.File file, java.lang.String encoding) throws org.eclipse.core.runtime.CoreException
Write the available profiles to the internal XML file.- Parameters:
profiles
- List ofCustomProfile
file
- File to writeencoding
- the encoding to use- Throws:
org.eclipse.core.runtime.CoreException
-
writeProfilesToStream
public static void writeProfilesToStream(java.util.Collection<ProfileManager.Profile> profiles, java.io.OutputStream stream, java.lang.String encoding) throws org.eclipse.core.runtime.CoreException
Save profiles to an XML stream- Parameters:
profiles
- the list ofCustomProfile
stream
- the stream to write toencoding
- the encoding to use- Throws:
org.eclipse.core.runtime.CoreException
-
-