Package org.eclipse.core.internal.utils

Examples of org.eclipse.core.internal.utils.ObjectMap


    }
  }

  private void readSyncInfo(IPath path, DataInputStream input, List readPartners) throws IOException, CoreException {
    int size = input.readInt();
    ObjectMap table = new ObjectMap(size);
    for (int i = 0; i < size; i++) {
      QualifiedName name = null;
      int type = input.readInt();
      switch (type) {
        case QNAME :
          String qualifier = input.readUTF();
          String local = input.readUTF();
          name = new QualifiedName(qualifier, local);
          readPartners.add(name);
          break;
        case INDEX :
          name = (QualifiedName) readPartners.get(input.readInt());
          break;
        default :
          //if we get here then the sync info file is corrupt
          String msg = NLS.bind(Messages.resources_readSync, path == null ? "" : path.toString()); //$NON-NLS-1$
          throw new ResourceException(IResourceStatus.FAILED_READ_METADATA, path, msg, null);
      }
      // read the bytes
      int length = input.readInt();
      byte[] bytes = new byte[length];
      input.readFully(bytes);
      // put them in the table
      table.put(name, bytes);
    }
    // set the table on the resource info
    ResourceInfo info = workspace.getResourceInfo(path, true, false);
    if (info == null)
      return;
View Full Code Here


    }
  }

  private void readSyncInfo(IPath path, DataInputStream input, List readPartners) throws IOException, CoreException {
    int size = input.readInt();
    ObjectMap table = new ObjectMap(size);
    for (int i = 0; i < size; i++) {
      QualifiedName name = null;
      byte type = input.readByte();
      switch (type) {
        case QNAME :
          String qualifier = input.readUTF();
          String local = input.readUTF();
          name = new QualifiedName(qualifier, local);
          readPartners.add(name);
          break;
        case INDEX :
          name = (QualifiedName) readPartners.get(input.readInt());
          break;
        default :
          //if we get here then the sync info file is corrupt
          String msg = NLS.bind(Messages.resources_readSync, path == null ? "" : path.toString()); //$NON-NLS-1$
          throw new ResourceException(IResourceStatus.FAILED_READ_METADATA, path, msg, null);
      }
      // read the bytes
      int length = input.readInt();
      byte[] bytes = new byte[length];
      input.readFully(bytes);
      // put them in the table
      table.put(name, bytes);
    }
    // set the table on the resource info
    ResourceInfo info = workspace.getResourceInfo(path, true, false);
    if (info == null)
      return;
View Full Code Here

    super(workspace, synchronizer);
  }

  private ObjectMap internalReadSyncInfo(DataInputStream input) throws IOException {
    int size = input.readInt();
    ObjectMap map = new ObjectMap(size);
    for (int i = 0; i < size; i++) {
      // read the qualified name
      String qualifier = input.readUTF();
      String local = input.readUTF();
      QualifiedName name = new QualifiedName(qualifier, local);
      // read the bytes
      int length = input.readInt();
      byte[] bytes = new byte[length];
      input.readFully(bytes);
      // put them in the table
      map.put(name, bytes);
    }
    return map;
  }
View Full Code Here

   * QNAME -> String String
   * BYTES -> byte[]
   */
  public void readSyncInfo(DataInputStream input) throws IOException {
    IPath path = new Path(input.readUTF());
    ObjectMap map = internalReadSyncInfo(input);
    // set the table on the resource info
    ResourceInfo info = workspace.getResourceInfo(path, true, false);
    if (info == null)
      return;
    info.setSyncInfo(map);
View Full Code Here

TOP

Related Classes of org.eclipse.core.internal.utils.ObjectMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.