1 11 package org.eclipse.core.internal.resources; 12 13 import java.io.DataInputStream ; 14 import org.eclipse.core.internal.utils.Messages; 15 import org.eclipse.core.internal.watson.ElementTree; 16 import org.eclipse.core.resources.IProject; 17 import org.eclipse.core.resources.IResourceStatus; 18 import org.eclipse.core.runtime.CoreException; 19 import org.eclipse.core.runtime.IProgressMonitor; 20 import org.eclipse.osgi.util.NLS; 21 22 27 public abstract class WorkspaceTreeReader { 28 31 public static WorkspaceTreeReader getReader(Workspace workspace, int version) throws CoreException { 32 switch (version) { 33 case ICoreConstants.WORKSPACE_TREE_VERSION_1 : 34 return new WorkspaceTreeReader_1(workspace); 35 case ICoreConstants.WORKSPACE_TREE_VERSION_2 : 36 return new WorkspaceTreeReader_2(workspace); 37 default : 38 String msg = NLS.bind(Messages.resources_format, new Integer (version)); 40 throw new ResourceException(IResourceStatus.FAILED_READ_METADATA, null, msg, null); 41 } 42 } 43 44 47 public abstract ElementTree readSnapshotTree(DataInputStream input, ElementTree complete, IProgressMonitor monitor) throws CoreException; 48 49 52 public abstract void readTree(DataInputStream input, IProgressMonitor monitor) throws CoreException; 53 54 57 public abstract void readTree(IProject project, DataInputStream input, IProgressMonitor monitor) throws CoreException; 58 } 59 | Popular Tags |