public class StreamAccessorStorage extends Object implements org.eclipse.core.resources.IStorage, IStoragePathAdapterProvider
Constructor and Description |
---|
StreamAccessorStorage(org.eclipse.compare.IStreamContentAccessor accessor,
String fullPath)
Wraps the given accessor.
|
Modifier and Type | Method and Description |
---|---|
Adapter |
createStoragePathAdapter(String path,
boolean isLocal)
This method is used to create a new StoragePathAdapter.
|
static org.eclipse.team.core.history.IFileRevision |
findCommitId(org.eclipse.compare.ITypedElement element)
Get the commit id for the given element
|
static StreamAccessorStorage |
fromTypedElement(org.eclipse.compare.ITypedElement element)
This is a short-hand for
fromTypedElement(String, ITypedElement) . |
static StreamAccessorStorage |
fromTypedElement(String storagePath,
org.eclipse.compare.ITypedElement element)
Creates a StreamAccessorStorage given the input typed element.
|
Object |
getAdapter(Class adapter) |
InputStream |
getContents() |
org.eclipse.core.runtime.IPath |
getFullPath() |
String |
getName() |
boolean |
isReadOnly() |
public StreamAccessorStorage(org.eclipse.compare.IStreamContentAccessor accessor, String fullPath)
accessor
- The accessor to wrap as an IStorage.fullPath
- Full path to the underlying storage.public static StreamAccessorStorage fromTypedElement(org.eclipse.compare.ITypedElement element) throws IllegalArgumentException
fromTypedElement(String, ITypedElement)
. This second one should be
preferred in case the given element is remote and we need a proper path for it.element
- The typed element for which we need to create a wrapper.IllegalArgumentException
- If the given element does not implement IStreamContentAccessor
.public static StreamAccessorStorage fromTypedElement(String storagePath, org.eclipse.compare.ITypedElement element) throws IllegalArgumentException
IStreamContentAccessor
as well.storagePath
- The full path to this storage, can be null
.element
- The typed element for which we need to create a wrapper.IllegalArgumentException
- If the given element does not implement IStreamContentAccessor
.public static org.eclipse.team.core.history.IFileRevision findCommitId(org.eclipse.compare.ITypedElement element)
element
- The element for which we want the commit idpublic Adapter createStoragePathAdapter(String path, boolean isLocal)
createStoragePathAdapter
in interface IStoragePathAdapterProvider
path
- The path to use.isLocal
- Whether this storage is local.IStoragePathAdapterProvider#createStoragePathAdapter()
public Object getAdapter(Class adapter)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
IAdaptable.getAdapter(java.lang.Class)
public InputStream getContents() throws org.eclipse.core.runtime.CoreException
getContents
in interface org.eclipse.core.resources.IStorage
org.eclipse.core.runtime.CoreException
IStorage.getContents()
public org.eclipse.core.runtime.IPath getFullPath()
getFullPath
in interface org.eclipse.core.resources.IStorage
IStorage.getFullPath()
public String getName()
getName
in interface org.eclipse.core.resources.IStorage
IStorage.getName()
public boolean isReadOnly()
isReadOnly
in interface org.eclipse.core.resources.IStorage
IStorage.isReadOnly()
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.