PTP
Release 5.0

org.eclipse.ptp.remote.core
Class RemoteServicesDelegate

java.lang.Object
  extended by org.eclipse.ptp.remote.core.RemoteServicesDelegate

public class RemoteServicesDelegate
extends Object

A wrapper for holding initialized remote services information.
Also contains convenience utilities associated with remote file operations.

Since:
5.0
See Also:
IRemoteFileManager, IFileStore

Constructor Summary
RemoteServicesDelegate(String remoteServicesId, String remoteConnectionName)
           
 
Method Summary
static void copy(IRemoteFileManager from, String source, IRemoteFileManager to, String target, int mkParent, org.eclipse.core.runtime.IProgressMonitor progress)
           
 IRemoteConnection getLocalConnection()
           
 IRemoteConnectionManager getLocalConnectionManager()
           
 IRemoteFileManager getLocalFileManager()
           
 URI getLocalHome()
           
 IRemoteServices getLocalServices()
           
 IRemoteConnection getRemoteConnection()
           
 IRemoteConnectionManager getRemoteConnectionManager()
           
 IRemoteFileManager getRemoteFileManager()
           
 URI getRemoteHome()
           
 IRemoteServices getRemoteServices()
           
 void initialize(org.eclipse.core.runtime.IProgressMonitor monitor)
          On the basis of the passed in identifiers, constructs the local and remote services, connection manager, connection, file manager and home URIs.
static boolean isStable(IRemoteFileManager manager, String path, int intervalInSecs, org.eclipse.core.runtime.IProgressMonitor progress)
          Checks for existence of file.
static String read(IRemoteFileManager manager, String path, org.eclipse.core.runtime.IProgressMonitor progress)
           
static void write(IRemoteFileManager manager, String path, String contents, org.eclipse.core.runtime.IProgressMonitor progress)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteServicesDelegate

public RemoteServicesDelegate(String remoteServicesId,
                              String remoteConnectionName)
Parameters:
remoteServicesId - e.g., "local", "remotetools", "rse"
remoteConnectionName - e.g., "ember.ncsa.illinois.edu"
Method Detail

getLocalConnection

public IRemoteConnection getLocalConnection()

getLocalConnectionManager

public IRemoteConnectionManager getLocalConnectionManager()

getLocalFileManager

public IRemoteFileManager getLocalFileManager()

getLocalHome

public URI getLocalHome()

getLocalServices

public IRemoteServices getLocalServices()

getRemoteConnection

public IRemoteConnection getRemoteConnection()

getRemoteConnectionManager

public IRemoteConnectionManager getRemoteConnectionManager()

getRemoteFileManager

public IRemoteFileManager getRemoteFileManager()

getRemoteHome

public URI getRemoteHome()

getRemoteServices

public IRemoteServices getRemoteServices()

initialize

public void initialize(org.eclipse.core.runtime.IProgressMonitor monitor)
                throws org.eclipse.core.runtime.CoreException
On the basis of the passed in identifiers, constructs the local and remote services, connection manager, connection, file manager and home URIs.

Parameters:
monitor -
Throws:
org.eclipse.core.runtime.CoreException

copy

public static void copy(IRemoteFileManager from,
                        String source,
                        IRemoteFileManager to,
                        String target,
                        int mkParent,
                        org.eclipse.core.runtime.IProgressMonitor progress)
                 throws org.eclipse.core.runtime.CoreException
Parameters:
from - manager for source resource
source - file to copy
to - manager for target resource
target - destination file
mkParent - EFS.NONE = mkdir -p on the parent directory; EFS.SHALLOW = mkdir parent; UNDEFINED = no mkdir
progress -
Throws:
org.eclipse.core.runtime.CoreException

isStable

public static boolean isStable(IRemoteFileManager manager,
                               String path,
                               int intervalInSecs,
                               org.eclipse.core.runtime.IProgressMonitor progress)
                        throws org.eclipse.core.runtime.CoreException
Checks for existence of file. If it does exist, tests to see if it is stable by checking size after the given timeout.

Parameters:
manager - for resource where file is located
path - of file
intervalInSecs - time after which to check size of file again
progress -
Returns:
true if file exists and is not being written to over the given interval.
Throws:
org.eclipse.core.runtime.CoreException

read

public static String read(IRemoteFileManager manager,
                          String path,
                          org.eclipse.core.runtime.IProgressMonitor progress)
                   throws org.eclipse.core.runtime.CoreException
Parameters:
manager - for resource where file is located
path - of file
progress -
Returns:
contents of file
Throws:
org.eclipse.core.runtime.CoreException

write

public static void write(IRemoteFileManager manager,
                         String path,
                         String contents,
                         org.eclipse.core.runtime.IProgressMonitor progress)
                  throws org.eclipse.core.runtime.CoreException
Parameters:
manager - for resource where file is to be written
path - of file to write
contents - to write to file
progress -
Throws:
org.eclipse.core.runtime.CoreException

PTP
Release 5.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.