1 11 package org.eclipse.core.internal.resources; 12 13 import java.io.DataInputStream ; 14 import java.io.IOException ; 15 import org.eclipse.core.internal.utils.ObjectMap; 16 import org.eclipse.core.runtime.*; 17 18 public class SyncInfoSnapReader_3 extends SyncInfoSnapReader { 19 20 public SyncInfoSnapReader_3(Workspace workspace, Synchronizer synchronizer) { 21 super(workspace, synchronizer); 22 } 23 24 private ObjectMap internalReadSyncInfo(DataInputStream input) throws IOException { 25 int size = input.readInt(); 26 ObjectMap map = new ObjectMap(size); 27 for (int i = 0; i < size; i++) { 28 String qualifier = input.readUTF(); 30 String local = input.readUTF(); 31 QualifiedName name = new QualifiedName(qualifier, local); 32 int length = input.readInt(); 34 byte[] bytes = new byte[length]; 35 input.readFully(bytes); 36 map.put(name, bytes); 38 } 39 return map; 40 } 41 42 52 public void readSyncInfo(DataInputStream input) throws IOException { 53 IPath path = new Path(input.readUTF()); 54 ObjectMap map = internalReadSyncInfo(input); 55 ResourceInfo info = workspace.getResourceInfo(path, true, false); 57 if (info == null) 58 return; 59 info.setSyncInfo(map); 60 info.clear(ICoreConstants.M_SYNCINFO_SNAP_DIRTY); 61 } 62 } 63 | Popular Tags |