public class StreamAccessorStorage extends Object implements org.eclipse.core.resources.IStorage
Constructor and Description |
---|
StreamAccessorStorage(org.eclipse.compare.IStreamContentAccessor accessor,
String fullPath)
Wraps the given accessor.
|
Modifier and Type | Method and Description |
---|---|
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 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.