PTP
Release 7.0

org.eclipse.ptp.remote.core
Interface IRemoteResource


public interface IRemoteResource

Abstraction of a remote resource. There are currently two types of remote resources: fully remote and synchronized. This interface provides a common mechanism for accessing resource information from either type. Usage: IRemoteResource remoteRes = (IRemoteResource)resource.getAdapter(IRemoteResource.class); if (remoteRes != null) { URI location = remoteRes.getDefaultLocationURI(); ... }

Since:
6.0

Method Summary
 java.net.URI getActiveLocationURI()
          Get the active location URI of the resource in the remote project.
 IResource getResource()
          Get the platform resource corresponding to the remote resource
 void refresh(IProgressMonitor monitor)
          Synchronize the resource with the underlying filesystem.
 void setResource(IResource resource)
          Set the platform resource
 

Method Detail

getActiveLocationURI

java.net.URI getActiveLocationURI()
Get the active location URI of the resource in the remote project. Returns null if the URI can't be obtained (@see IResource#getLocationURI()). For fully remote projects, this is just the URI of the remote resource. For synchronized projects, this is the URI of the resource from the active synchronization target.

Returns:
URI or null if URI can't be obtained

getResource

IResource getResource()
Get the platform resource corresponding to the remote resource

Returns:
IResource

refresh

void refresh(IProgressMonitor monitor)
             throws CoreException
Synchronize the resource with the underlying filesystem. Performs a refresh for local and remote projects, but causes synchronized projects to attempt to synchronize with their remote files. May synchronize more than just the single resource. Blocks until the refresh has completed, so callers should use a job if necessary.

Parameters:
monitor - progress monitor to cancel refresh
Throws:
CoreException - if the underlying synchronization fails

setResource

void setResource(IResource resource)
Set the platform resource

Parameters:
resource - platform resource corresponding to this remote resource

PTP
Release 7.0

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