org.eclipse.emf.compare.ide.ui.internal.logical

## Class SubscriberStorageAccessor

- java.lang.Object
- - org.eclipse.emf.compare.ide.ui.internal.logical.SubscriberStorageAccessor

All Implemented Interfaces:
  IStorageProviderAccessor

    public final class SubscriberStorageAccessor
    extends Object
    implements IStorageProviderAccessor

This is used by our synchronization model to access the innards of Team's `Subscriber`s.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.emf.compare.ide.ui.logical.IStorageProviderAccessor

`IStorageProviderAccessor.DiffSide`

### Constructor Summary

Constructors
Constructor and Description
`SubscriberStorageAccessor(org.eclipse.team.core.subscribers.Subscriber subscriber)` Wraps the given subscriber within this accessor.

### Method Summary

All Methods Instance Methods Concrete Methods
`org.eclipse.core.resources.IFile` `getFileAfterRename(org.eclipse.core.resources.IFile originFile, IStorageProviderAccessor.DiffSide side)` Given an origin file, this method optionally returns the corresponding `IFile` after it has been renamed on the respective `side`, if it has been renamed at all.
`org.eclipse.core.resources.IFile` `getFileBeforeRename(org.eclipse.core.resources.IFile sourceOrRemoteFile, IStorageProviderAccessor.DiffSide side)` Given a source or remote file, this method optionally returns the corresponding `IFile` before it has been renamed on the respective `side`, if it has been renamed at all.
`IStorageProvider` `getStorageProvider(org.eclipse.core.resources.IResource resource, IStorageProviderAccessor.DiffSide side)` This will be called by the URI Converter to get the content associated with the given local resource (which might not exist locally).
`boolean` `isInSync(org.eclipse.core.resources.IResource resource)` Checks whether the given resource is considered "in sync".

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SubscriberStorageAccessor

    public SubscriberStorageAccessor(org.eclipse.team.core.subscribers.Subscriber subscriber)

Wraps the given subscriber within this accessor.

Parameters:
  `subscriber` - The wrapped subscriber.

### Method Detail

#### getStorageProvider

    public IStorageProvider getStorageProvider(org.eclipse.core.resources.IResource resource,
                                               IStorageProviderAccessor.DiffSide side)
                                        throws org.eclipse.core.runtime.CoreException

This will be called by the URI Converter to get the content associated with the given local resource (which might not exist locally).

Specified by:
  `getStorageProvider` in interface `IStorageProviderAccessor`
Parameters:
  `resource` - The resource we need content for.
  `side` - Side of the content we seek.
Returns:
  The content for the given side of the given resource.
Throws:
  `org.eclipse.core.runtime.CoreException` - Thrown if the underlying provider cannot be retrieved.
See Also:
  `IStorageProviderAccessor.getStorageProvider(org.eclipse.core.resources.IResource, org.eclipse.emf.compare.ide.ui.logical.IStorageProviderAccessor.DiffSide)`

#### isInSync

    public boolean isInSync(org.eclipse.core.resources.IResource resource)
                     throws org.eclipse.core.runtime.CoreException

Checks whether the given resource is considered "in sync".

Specified by:
  `isInSync` in interface `IStorageProviderAccessor`
Parameters:
  `resource` - The resource to check.
Returns:
  `true` if this resource is in sync with its remote variant, `false` otherwise.
Throws:
  `org.eclipse.core.runtime.CoreException` - Thrown if we cannot get the diff for this resource.
See Also:
  `IStorageProviderAccessor.isInSync(org.eclipse.core.resources.IResource)`

#### getFileBeforeRename

    public org.eclipse.core.resources.IFile getFileBeforeRename(org.eclipse.core.resources.IFile sourceOrRemoteFile,
                                                                IStorageProviderAccessor.DiffSide side)

Given a source or remote file, this method optionally returns the corresponding `IFile` before it has been renamed on the respective `side`, if it has been renamed at all.

Implementers should delegate this to `RenameDetector`.

Specified by:
  `getFileBeforeRename` in interface `IStorageProviderAccessor`
Parameters:
  `sourceOrRemoteFile` - The potentially renamed file.
  `side` - The `IStorageProviderAccessor.DiffSide` to look for the rename (only `IStorageProviderAccessor.DiffSide.SOURCE` or `IStorageProviderAccessor.DiffSide.REMOTE` are valid).
Returns:
  The file before the rename, if it has been renamed at all, `null` otherwise.

#### getFileAfterRename

    public org.eclipse.core.resources.IFile getFileAfterRename(org.eclipse.core.resources.IFile originFile,
                                                               IStorageProviderAccessor.DiffSide side)

Given an origin file, this method optionally returns the corresponding `IFile` after it has been renamed on the respective `side`, if it has been renamed at all.

Implementers should delegate this to `RenameDetector`.

Specified by:
  `getFileAfterRename` in interface `IStorageProviderAccessor`
Parameters:
  `originFile` - The potentially renamed file.
  `side` - The `IStorageProviderAccessor.DiffSide` to look for the rename (only `IStorageProviderAccessor.DiffSide.SOURCE` or `IStorageProviderAccessor.DiffSide.REMOTE` are valid).
Returns:
  The file after the rename, if it has been renamed at all, `null` otherwise.