|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.files.ui.resources.SystemTempFileListener
org.eclipse.rse.files.ui.resources.SystemUniversalTempFileListener
public class SystemUniversalTempFileListener
This class manages listening for resource changes within our temp file project It is used for listening to saves made in the editor so that we can upload changes to the remote files. This class specifically handles universal files and doesn't do anything for iSeries. For iSeries members we need to subclass this.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.rse.files.ui.resources.SystemTempFileListener |
---|
SystemTempFileListener.RefreshResourcesJob, SystemTempFileListener.RefreshResourcesUIJob |
Constructor Summary | |
---|---|
SystemUniversalTempFileListener()
|
Method Summary | |
---|---|
protected boolean |
doesHandle(ISubSystem subsystem)
Indicate whether this tempfile listener handles the specified |
protected void |
doResourceSynchronization(ISubSystem subsystem,
IFile tempFile,
String resourceId,
IProgressMonitor monitor)
Synchronize the specified remote file with the temporary local file using the specified remote file subsystem. |
SystemEditableRemoteFile |
getEditedFile(IRemoteFile file)
|
static SystemUniversalTempFileListener |
getListener()
Return singleton |
void |
registerEditedFile(SystemEditableRemoteFile editMember)
|
void |
unregisterEditedFile(SystemEditableRemoteFile editMember)
|
void |
upload(IRemoteFileSubSystem fs,
IRemoteFile remoteFile,
IFile tempFile,
SystemIFileProperties properties,
long storedModifiedStamp,
SystemEditableRemoteFile editable,
IProgressMonitor monitor)
This method attempts to upload a temporary file in the workspace to a corresponding remote file location. |
Methods inherited from class org.eclipse.rse.files.ui.resources.SystemTempFileListener |
---|
addIgnoreFile, checkLocalChanges, getRunnableContext, isIgnorable, preScanForTempFiles, processDelta, refreshRemoteResource, removeIgnoreFile, resourceChanged, setEnabled, synchronizeTempWithRemote |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SystemUniversalTempFileListener()
Method Detail |
---|
public static SystemUniversalTempFileListener getListener()
public void registerEditedFile(SystemEditableRemoteFile editMember)
public void unregisterEditedFile(SystemEditableRemoteFile editMember)
public SystemEditableRemoteFile getEditedFile(IRemoteFile file)
protected boolean doesHandle(ISubSystem subsystem)
doesHandle
in class SystemTempFileListener
subsystem
- the subsystem to check
protected void doResourceSynchronization(ISubSystem subsystem, IFile tempFile, String resourceId, IProgressMonitor monitor)
doResourceSynchronization
in class SystemTempFileListener
subsystem
- the remote file subsystem of the remote filetempFile
- the temporary fileresourceId
- the remote filemonitor
- progress monitorpublic void upload(IRemoteFileSubSystem fs, IRemoteFile remoteFile, IFile tempFile, SystemIFileProperties properties, long storedModifiedStamp, SystemEditableRemoteFile editable, IProgressMonitor monitor)
Warning It is important to make sure that the remoteFile that gets passed in is up-to-date AND is the current cached version. If the remoteFile is not up-to-date then the timestamp of the actual remote file may be wrong and lead to the following problems:
Because of these problems, it is recommended that, before calling upload(), the remoteFile is retrieved from the cache and is
marked stale like the following example:
...
// get the remote file from the cache
IRemoteFile remoteFile = fs.getRemoteFileObject(remoteFile.getAbsolutePath(), monitor);
// mark it stale
remoteFile.markStale(true);
// re-query the remote file to make sure you have the latest
remoteFile = fs.getRemoteFileObject(remoteFile.getAbsolutePath(), monitor);
// call upload
upload(fs, remoteFile, ...);
....
fs
- the file subsystem that corresponds with the file to uploadremoteFile
- the remote file location to upload totempFile
- the source temp file to uploadproperties
- the remote file properties of the file to uploadstoredModifiedStamp
- the last timestamp of the remote file for which a temp file was in synch with the remote fileeditable
- the wrapper that associates the remote file, temp file and editor togethermonitor
- the progress monitor
|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |