Remote Systems
v6.4.1

com.ibm.etools.systems.model
Class SystemMOFHelpers

java.lang.Object
  extended bycom.ibm.etools.systems.model.SystemMOFHelpers

public class SystemMOFHelpers
extends Object

Common methods that abstract out common MOF operations.

We could have made these methods static, but decided instead to support multiple instances of the class, so each instance can support a different log file.

An internal table keyed by logfile is maintained, so that multiple factory requests for an instance, given the same logfile, returns the same instance.


Field Summary
static String copyright
           
static String MOF_EXTENSION
          Extension for all mof files: ".xmi"
 
Constructor Summary
protected SystemMOFHelpers(Logger logger)
          Constructor
 
Method Summary
static String addPathTerminator(String path)
          Ensure given path ends with path separator.
static String getFolderPath(IFolder folder)
          Return the path of the given folder
static SystemMOFHelpers getMOFHelpers(Logger log)
          Return the singleton instance of this class for the logger file.
static IFile getSaveFile(IFolder folder, String fileNameNoExtension)
          Return the IFile that will be saved to
static String getSaveFileName(String fileNameNoExtension)
          If saving all info in one file, this returns the un-qualified name of that file, given the file name without the .xmi extension.
static String getSaveFilePathAndName(IFolder folder, String fileNameNoExtension)
          If saving all info in one file, this returns the fully qualified name of that file, given the file name without the .xmi extension.
 EList restore(IFolder folder, String fileName)
          Restore given MOF file
 void save(IFolder folder, String fileName, EObject saveObject)
          Common MOF save to one file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

MOF_EXTENSION

public static final String MOF_EXTENSION
Extension for all mof files: ".xmi"

See Also:
Constant Field Values
Constructor Detail

SystemMOFHelpers

protected SystemMOFHelpers(Logger logger)
Constructor

Method Detail

getMOFHelpers

public static SystemMOFHelpers getMOFHelpers(Logger log)
Return the singleton instance of this class for the logger file.


save

public void save(IFolder folder,
                 String fileName,
                 EObject saveObject)
          throws Exception
Common MOF save to one file

Parameters:
folder - the folder to save the file into.
fileName - the unqualified file name, without the .xml extension.
saveObject - the object to be saved to given file.
Throws:
Exception

restore

public EList restore(IFolder folder,
                     String fileName)
              throws Exception
Restore given MOF file

Parameters:
folder - the folder to save the file into.
fileName - the unqualified file name, without the .xmi extension.
Returns:
the MOF EList object if all went well. (Use iterator() to get each restored object from the Extent). Returns null if given folder or file not found, ands throws exceptions for other errors. was: //public Extent restore(IFolder folder, String fileName) throws Exception
Throws:
Exception

getSaveFile

public static IFile getSaveFile(IFolder folder,
                                String fileNameNoExtension)
Return the IFile that will be saved to


getSaveFilePathAndName

public static String getSaveFilePathAndName(IFolder folder,
                                            String fileNameNoExtension)
If saving all info in one file, this returns the fully qualified name of that file, given the file name without the .xmi extension.


getSaveFileName

public static String getSaveFileName(String fileNameNoExtension)
If saving all info in one file, this returns the un-qualified name of that file, given the file name without the .xmi extension.


addPathTerminator

public static String addPathTerminator(String path)
Ensure given path ends with path separator.


getFolderPath

public static String getFolderPath(IFolder folder)
Return the path of the given folder


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.