1 11 package org.eclipse.update.internal.core; 12 import org.eclipse.core.runtime.*; 13 import org.eclipse.update.core.*; 14 15 18 19 public class PluginEntryContentConsumer extends ContentConsumer { 20 21 private boolean closed = false; 22 23 private IContentConsumer contentConsumer; 24 25 28 public PluginEntryContentConsumer(IContentConsumer contentConsumer){ 29 this.contentConsumer = contentConsumer; 30 } 31 32 35 public void store(ContentReference contentReference, IProgressMonitor monitor) throws CoreException { 36 if (!closed){ 37 contentConsumer.store(contentReference,monitor); 38 } else { 39 UpdateCore.warn("Attempt to store in a closed PluginEntryContentConsumer",new Exception ()); } 41 } 42 43 46 public void close() throws CoreException { 47 if (!closed){ 48 closed = true; 49 contentConsumer.close(); 50 } else { 51 UpdateCore.warn("Attempt to close a closed PluginEntryContentConsumer",new Exception ()); } 53 } 54 55 } 56 | Popular Tags |