Class ProfileStore
java.lang.Object
org.eclipse.m2m.atl.adt.ui.preferences.ProfileStore
Can load/store profiles from/to profilesKey
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreadProfiles(org.eclipse.core.runtime.preferences.IScopeContext scope) readProfilesFromFile(File file) Read the available profiles from the internal XML file and return them as collection ornullif the file is not a profile file.static List<ProfileManager.Profile> readProfilesFromStream(InputSource inputSource) Load profiles from a XML stream and add them to a map ornullif the source is not a profile store.readProfilesFromString(String profiles) voidwriteProfiles(Collection<ProfileManager.Profile> profiles, org.eclipse.core.runtime.preferences.IScopeContext instanceScope) voidwriteProfilesToFile(Collection<ProfileManager.Profile> profiles, File file, String encoding) Write the available profiles to the internal XML file.static voidwriteProfilesToStream(Collection<ProfileManager.Profile> profiles, OutputStream stream, String encoding) Save profiles to an XML stream
-
Field Details
-
ENCODING
The default encoding to use- See Also:
-
VERSION_KEY_SUFFIX
- See Also:
-
-
Constructor Details
-
ProfileStore
-
-
Method Details
-
readProfiles
public 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
nullif the loading failed. The elements are of typeProfileManager.CustomProfileand are all updated to the latest version. - Throws:
org.eclipse.core.runtime.CoreException
-
writeProfiles
public void writeProfiles(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 List<ProfileManager.Profile> readProfilesFromString(String profiles) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
readProfilesFromFile
public List<ProfileManager.Profile> readProfilesFromFile(File file) throws org.eclipse.core.runtime.CoreException Read the available profiles from the internal XML file and return them as collection ornullif the file is not a profile file.- Parameters:
file- The file to read from- Returns:
- returns a list of
CustomProfileornull - Throws:
org.eclipse.core.runtime.CoreException
-
readProfilesFromStream
public static List<ProfileManager.Profile> readProfilesFromStream(InputSource inputSource) throws org.eclipse.core.runtime.CoreException Load profiles from a XML stream and add them to a map ornullif the source is not a profile store.- Parameters:
inputSource- The input stream- Returns:
- returns a list of
CustomProfileornull - Throws:
org.eclipse.core.runtime.CoreException
-
writeProfilesToFile
public void writeProfilesToFile(Collection<ProfileManager.Profile> profiles, File file, String encoding) throws org.eclipse.core.runtime.CoreException Write the available profiles to the internal XML file.- Parameters:
profiles- List ofCustomProfilefile- File to writeencoding- the encoding to use- Throws:
org.eclipse.core.runtime.CoreException
-
writeProfilesToStream
public static void writeProfilesToStream(Collection<ProfileManager.Profile> profiles, OutputStream stream, String encoding) throws org.eclipse.core.runtime.CoreException Save profiles to an XML stream- Parameters:
profiles- the list ofCustomProfilestream- the stream to write toencoding- the encoding to use- Throws:
org.eclipse.core.runtime.CoreException
-