Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.resources
Class CachedQSYSRemoteMember

java.lang.Object
  extended by com.ibm.etools.iseries.rse.ui.resources.CachedQSYSRemoteMember

public class CachedQSYSRemoteMember
extends Object


Field Summary
static String copyright
           
 
Constructor Summary
CachedQSYSRemoteMember(IQSYSMember member)
           
 
Method Summary
static IQSYSMember createTempMember(Shell shell, IBMiConnection connection, String libName, String fileName, String mbrName, String[] contents)
          Create a temporary source member and populate it with the given contents.
static IQSYSMember createTempMember(Shell shell, IBMiConnection connection, String libName, String fileName, String mbrName, String mbrType, String[] contents)
          Create a temporary source member and populate it with the given contents.
 boolean download(IProgressMonitor monitor, boolean leaveVisual, boolean force)
          Download the member.
 boolean download(IProgressMonitor monitor, boolean leaveVisual, boolean force, boolean doRefresh)
          Download the member.
 QSYSEditableRemoteSourceFileMember getAccess()
          Return an instance of QSYSEditableRemoteSourceFileMember for this member, which has a number of useful methods, beyond just opening the member for edit.
 IFile getCachedCopy()
          Return the cached copy of the IQSYSMember member.
 ISequentialFileReader getContentsLineByLine()
          Return the contents of the files once it is downloaded, one line at a time.
 ISequentialFileReader getContentsLineByLine(boolean transientDownload, boolean bidiVisual)
          Return a reader to access the contents of the member line by line.
 String getDownloadPath()
          retrieves the path being used for downloading
 IFile getLocalResource()
           
 String getRemotePath()
          Retrieves the remote path of the member on the iSeries
 void refresh()
          Refresh the remote edit project.
 void setRemoveTrailingBlanks(boolean value)
          Sets whether or not trailing blanks should be removed upon download.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static String copyright
Constructor Detail

CachedQSYSRemoteMember

public CachedQSYSRemoteMember(IQSYSMember member)
Method Detail

getCachedCopy

public IFile getCachedCopy()
                    throws SystemMessageException
Return the cached copy of the IQSYSMember member. The returned IFile must be used for read-only purposes since no locks are acquired on the remote member.

Returns:
IFile The cached copy of this member if it exists AND it is upto date. null is returned if a local cached copy of this member is not available or the local cached copy is not upto date (last modified timestamp comparison.)
Throws:
SystemMessageException

getAccess

public QSYSEditableRemoteSourceFileMember getAccess()
                                             throws SystemMessageException
Return an instance of QSYSEditableRemoteSourceFileMember for this member, which has a number of useful methods, beyond just opening the member for edit. For example, you can get to the contents of the member by asking for its IFile handle (which will download it if and only if necessary).

Throws:
SystemMessageException

getContentsLineByLine

public ISequentialFileReader getContentsLineByLine()
                                            throws Exception
Return the contents of the files once it is downloaded, one line at a time. Return null if there was a problem downloading the member or opening the local file

Throws:
Exception
See Also:
IISeriesMember.getContentsLineByLine()

getContentsLineByLine

public ISequentialFileReader getContentsLineByLine(boolean transientDownload,
                                                   boolean bidiVisual)
                                            throws Exception
Return a reader to access the contents of the member line by line.

Parameters:
transientDownload - Specifies if the temporary copy of the member downloaded for the reader is deleted after the reader completes.
bidiVisual - If the file contains BIDI text then the text is returned in visual format. If bidiVisual is true then transientDownload is ignored and assumed to be true. This is because the local copy cannot be added to the workspace if it is BIDI and in visual ordering. Note: transientDownload determines whether caching occurs, irrespective of the sense of bidiVisual. See ISeriesSrcPhysicalFileMemberTransientReader() for transientDownload usage there.
Throws:
Exception

getDownloadPath

public String getDownloadPath()
retrieves the path being used for downloading

Returns:
the filename where the member will be downloaded
Since:
6.0.1

getLocalResource

public IFile getLocalResource()

getRemotePath

public String getRemotePath()
Retrieves the remote path of the member on the iSeries

Returns:
The remote path
Since:
6.0.1 //59962

download

public boolean download(IProgressMonitor monitor,
                        boolean leaveVisual,
                        boolean force)
                 throws Exception
Download the member.

Parameters:
monitor - the progress monitor to show during the download. Can be null.
force - force a refresh of the RSE temp files project
Throws:
Exception
Since:
6.0.1

download

public boolean download(IProgressMonitor monitor,
                        boolean leaveVisual,
                        boolean force,
                        boolean doRefresh)
                 throws Exception
Download the member.

Parameters:
monitor - the progress monitor to show during the download. Can be null.
force - force a refresh of the RSE temp files project
Throws:
Exception
Since:
6.0.1

setRemoveTrailingBlanks

public void setRemoveTrailingBlanks(boolean value)
Sets whether or not trailing blanks should be removed upon download.

Parameters:
value - True if the trailing blanks should be stripped, false otherwise
Since:
6.0.1

refresh

public void refresh()
Refresh the remote edit project.

Since:
6.0.1 //59962

createTempMember

public static IQSYSMember createTempMember(Shell shell,
                                           IBMiConnection connection,
                                           String libName,
                                           String fileName,
                                           String mbrName,
                                           String mbrType,
                                           String[] contents)
                                    throws SystemMessageException
Create a temporary source member and populate it with the given contents. The rules are:

Returns:
null if library doesn't exist, or error occurs creating file or member
Throws:
SystemMessageException - if an error occurs while performing any operation. Wraps the remote system message

createTempMember

public static IQSYSMember createTempMember(Shell shell,
                                           IBMiConnection connection,
                                           String libName,
                                           String fileName,
                                           String mbrName,
                                           String[] contents)
                                    throws SystemMessageException
Create a temporary source member and populate it with the given contents. The rules are:

Returns:
null if library doesn't exist, or error occurs creating file or member
Throws:
SystemMessageException - if an error occurs while performing any operation. Wraps the remote system message

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 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.