|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.etools.iseries.perspective.internal.model.util.AbstractDownloadUtil com.ibm.etools.iseries.perspective.model.util.ISeriesNativeObjectUtil
public class ISeriesNativeObjectUtil
This is a utility class for creating and populating source physical files from remote objects. Two object models are supported, IQSYSSaveFiles that are RSE based objects, and AbstractISeriesNativeObject objects that are the iSeries Project based objects.
Field Summary | |
---|---|
static String |
COPYRIGHT
|
static String |
TEMP_BINARY_OBJ_SAVF_PREFIX
|
Constructor Summary | |
---|---|
ISeriesNativeObjectUtil()
|
Method Summary | |
---|---|
static IResource |
createFromObjectArray(Object[] objects,
IProject project,
IProgressMonitor monitor,
Shell shell,
List errorReceiverList)
Downloads an array of RSE IQSYSFile and IQSYSMember objects, or save files to a project. |
static IFolder |
createSRCPF(AbstractISeriesNativeObject iSeriesNativeObject,
IProgressMonitor monitor,
Shell shell)
Download method based on iSeries Project object model. |
static IFolder |
createSRCPF(String sourceFileName,
IProject project,
Properties sourceFileProperties)
Creates a new folder for a source physical file under the given project. |
static IFolder |
createSRCPFs(IQSYSSourceFile[] sourceFiles,
IProject project,
IProgressMonitor monitor,
Shell shell)
Download method based on the Remote Systems Explorer object model. |
static void |
deleteTempOarFiles(File tempFolder)
Deletes all temporary files that were created during binary object download operation |
protected static IFile |
downloadSaveFile(IQSYSSaveFile saveFile,
IProject project,
Shell shell,
com.ibm.etools.iseries.perspective.internal.ui.OracleDialog dlg,
IProgressMonitor monitor)
Creates an IFile for the save file under the iSeries Project. |
static String |
getBinaryFileTypeAndSubtypeExtension(IFile file)
Returns the extension combined with type and subtype for a local resource file which represent a binary object. |
static String |
getBinaryObjectDispayLabel(IFile file)
Returns the display label for a binary object local representation resource |
static String |
getBinaryObjectFileNameNoOAR(IFile file)
Returns the name of the binary object local resource without the ".oar" extension |
protected static Properties |
getBinaryObjectProperties(IQSYSObject object)
Returns a Properties object containing the description and last remote edit time of the object. |
static String |
getContainerDispayLabel(IResource resource)
Returns the display label for a container local representation resource |
static String |
getLeafObjectDispayLabel(IFile file)
Returns the display label for a leaf object local representation resource |
static String |
getNativeObjectNameWithTypeSubtype(IQSYSObject nativeObject)
Returns the extension combined with type and subtype for a local resource file which represent a binary object. |
protected static Properties |
getSaveFileProperties(IQSYSSaveFile object)
Returns a Properties object containing the description and last remote edit time of the object. |
static boolean |
hasAllLocalSavfOrBinaryObjectSelection(IStructuredSelection selection)
Returns whether the types of the resources in the given selection are all local save files. |
static boolean |
hasAnyLocalSavfOrOARFileSelection(IStructuredSelection selection)
Returns whether any resource in the given selection is a local save file or a local resource for binary object. |
static boolean |
hasAnyLocalSavfSelection(IStructuredSelection selection)
Returns whether any resource in the given selection is a local save file. |
static boolean |
isBinaryObjectLocalResourceFile(IFile file)
|
static boolean |
isConnectionDownException(SystemMessageException se)
|
static boolean |
isParentedBinaryObjectFile(IFile file)
This method will check if we are visiting a file that represents an save file. |
static boolean |
isParentedSaveFile(IFile file)
This method will check if we are visiting a file that represents an save file. |
static boolean |
isSaveFile(IFile file)
A convenience method to determine whether a file represents either a save file or otherwise. |
Methods inherited from class com.ibm.etools.iseries.perspective.internal.model.util.AbstractDownloadUtil |
---|
checkMemberName, checkMemberType, checkSourceFileName, createMember, downloadMember, generateProperties, getDialogTitle, getStandardPath, getStandardPath, getStandardPath, hasStandardPath, hasStandardPath, makeSourceFileFolder, makeSourceFileFolder, queryDownload, queryDownload, queryDownload, setSourceProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String COPYRIGHT
public static final String TEMP_BINARY_OBJ_SAVF_PREFIX
Constructor Detail |
---|
public ISeriesNativeObjectUtil()
Method Detail |
---|
public static final IFolder createSRCPF(AbstractISeriesNativeObject iSeriesNativeObject, IProgressMonitor monitor, Shell shell) throws SystemMessageException
Downloads a full source file to the local project it is associated with. If the folder representing the source file does not exist one is created and the metadata file is generated accordingly. If the folder already exists the properties are verified against the downloaded source file. If any of the members exists, a pop-up asks for download confirmation.
The passed AbstractISeriesNativeObject must represent a source physical file, otherwise an IllegalArgumentException is thrown.
This method must be run as a WorkspaceModifyOperation
, so
that all resource modifications are reported as one delta when operation
succeeds.
iSeriesNativeObject
- the AbstractISeriesNativeMember that needs to be downloaded.monitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired. The monitor is
begun and ended in this method.shell
- parent shell for error messages. Pass null
to
use active shell.
null
if method fails, or
if the passed source file has an invalid name.
SystemMessageException
- if the source file or any of its members could not be
downloaded.
OperationCanceledException
- if the operation is canceled.
IllegalArgumentException
- if the first parameter is not a source file.public static final IFolder createSRCPFs(IQSYSSourceFile[] sourceFiles, IProject project, IProgressMonitor monitor, Shell shell) throws SystemMessageException
Downloads an array of source physical files to the target project. If the folder counterpart to the source file does not exist one is created and its metadata file is generated accordingly. If the folder already exists the source file properties are verified against the downloaded source file. If any of the members exists a popup asks for download confirmation.
Returns the last IFolder in the array of srcpf being downloaded. The naming rules for the object names are as follows:
Note: This method must be run as a WorkspaceModifyOperation
,
so that all resource modifcations are reported as one delta when
operation succeeds.
sourceFiles
- an array of IQSYSFile objects to be downloaded.project
- the project under which to create the folders representing the
source files.monitor
- a progress monitor, or null
if progress
reporting and cancelation are not desired.shell
- parent shell for error messages. Pass null
to
use active shell.
SystemMessageException
- if errors occur during operation.
OperationCanceledException
- if the operation is canceled.
IllegalArgumentException
- if the names of the files are invalid or the files are not
source files.public static final IResource createFromObjectArray(Object[] objects, IProject project, IProgressMonitor monitor, Shell shell, List errorReceiverList) throws SystemMessageException
If the members in this array are covered by downloaded files then they are not downloaded individually. Downloading a member will automatically cause its containing source file folder to be created if necessary.
This method must be run as a WorkspaceModifyOperation
, so
that all resource modifications are reported as one delta when operation
succeeds.
objects
- an array where all objects must be all IQSYSMembers, all
IQSYSFiles or all IQSYSSaveFiles (for save files).project
- the project to where the objects or members need to be
downloaded.monitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired.shell
- parent shell for error messages. Pass null
to
use active shell.
null
if nothing is downloaded.
SystemMessageException
- if errors occur during operation.
OperationCanceledException
- if the operation is canceled while in progress.
IllegalArgumentException
- if the array contains objects which are not members or source
files.public static final IFolder createSRCPF(String sourceFileName, IProject project, Properties sourceFileProperties) throws SystemMessageException
This method must be run as a WorkspaceModifyOperation
, so
that all resource modifications are reported as one delta when operation
succeeds.
sourceFileName
- the name of the new source physical file. It is assumed that
the name follows iSeries naming conventions.project
- the project in which to create the folder for the source
physical file.sourceFileProperties
- the properties of the source physical file.
SystemMessageException
- if errors occur during operation.
IllegalArgumentException
- if the source file name is invalid.protected static IFile downloadSaveFile(IQSYSSaveFile saveFile, IProject project, Shell shell, com.ibm.etools.iseries.perspective.internal.ui.OracleDialog dlg, IProgressMonitor monitor) throws SystemMessageException
saveFile
- The save file to download.project
- The iSeries project where the save file is going to be
downloaded.monitor
- A progress monitor, or null
if progress
reporting and cancelation are not desired.shell
- parent shell for error messages. Pass null
to
use active shell.
SystemMessageException
public static boolean isConnectionDownException(SystemMessageException se)
protected static final Properties getSaveFileProperties(IQSYSSaveFile object)
null
is returned
to signal failure.
member
- the source member from which to get the properties.
null
if the method fails to retrieve any
the of the properties from the IQSYSMember object..protected static final Properties getBinaryObjectProperties(IQSYSObject object)
null
is returned
to signal failure.
member
- the source member from which to get the properties.
null
if the method fails to retrieve any
the of the properties from the IQSYSMember object..public static final boolean isSaveFile(IFile file)
IFile
is an IProject.false
.
This should be used only for save file support and nothing else,
especially if using to check if file
is NOT a save
file, since method ALWAYS returns
false
if AE plug-in is disabled.
file
- The IFile
to check if it's a save file or not.
True
if the file represents a save file using the
criteria listed; false
otherwise.public static final boolean isBinaryObjectLocalResourceFile(IFile file)
public static boolean isParentedSaveFile(IFile file)
public static boolean isParentedBinaryObjectFile(IFile file)
public static final boolean hasAllLocalSavfOrBinaryObjectSelection(IStructuredSelection selection)
true
.
true
if all the selected objects are local save
files; false
otherwise.public static final boolean hasAnyLocalSavfSelection(IStructuredSelection selection)
true
.
true
if any of the selected resources is a local
save file; false
otherwise.public static final boolean hasAnyLocalSavfOrOARFileSelection(IStructuredSelection selection)
true
.
true
if any of the selected resources is a local
save file or a local resource for binary object; false
otherwise.public static final String getBinaryFileTypeAndSubtypeExtension(IFile file)
public static final String getNativeObjectNameWithTypeSubtype(IQSYSObject nativeObject)
public static final String getBinaryObjectDispayLabel(IFile file)
public static final String getLeafObjectDispayLabel(IFile file)
public static final String getContainerDispayLabel(IResource resource)
public static final String getBinaryObjectFileNameNoOAR(IFile file)
public static void deleteTempOarFiles(File tempFolder)
tempFolder
- Temporary folder containing all temp files
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |