package de.tudresden.slr.model.bibtex.ui.presentation.serialization;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;

import de.tudresden.slr.model.bibtex.impl.DocumentImpl;

public class DocumentStorage implements IStorage {
	private DocumentImpl document;

	public DocumentStorage(DocumentImpl document) {
		this.document = document;
	}

	@Override
	public Object getAdapter(Class adapter) {
		return null;
	}

	@Override
	public InputStream getContents() throws CoreException {
		return new ByteArrayInputStream(document.getKey().getBytes());
	}

	@Override
	public IPath getFullPath() {
		return null;
	}

	@Override
	public String getName() {
		return document.getKey();
	}

	@Override
	public boolean isReadOnly() {
		return false;
	}

	public DocumentImpl getDocument() {
		return document;
	}
}

@@ -301,21 +301,16 @@
 tex.
-impl.
 Document
 Impl
@@ -305,20 +305,16 @@
 Document
-Impl
 ;%0A%0Apubli
@@ -368,36 +368,32 @@
 private Document
-Impl
  document;%0A%0A%09pub
@@ -420,20 +420,16 @@
 Document
-Impl
  documen
@@ -887,12 +887,8 @@
 ment
-Impl
  get

Use document instead of documentimpl