示例#1
0
  @Override
  public synchronized DirectoryPrx createDirectory(String name, Ice.Current current)
      throws NameInUse {
    if (_destroyed) {
      throw new Ice.ObjectNotExistException(current.id, current.facet, current.operation);
    }

    if (name.length() == 0 || nodes.containsKey(name)) {
      throw new NameInUse(name);
    }

    Ice.Identity id =
        current.adapter.getCommunicator().stringToIdentity(java.util.UUID.randomUUID().toString());
    PersistentDirectory dir = new DirectoryI();
    dir.nodeName = name;
    dir.parent =
        PersistentDirectoryPrxHelper.uncheckedCast(current.adapter.createProxy(current.id));
    DirectoryPrx proxy = DirectoryPrxHelper.uncheckedCast(_evictor.add(dir, id));

    NodeDesc nd = new NodeDesc();
    nd.name = name;
    nd.type = NodeType.DirType;
    nd.proxy = proxy;
    nodes.put(name, nd);

    return proxy;
  }
示例#2
0
 public FileI(String name, DirectoryI parent) {
   _name = name;
   _parent = parent;
   _destroyed = false;
   _id = new Identity();
   _id.name = java.util.UUID.randomUUID().toString();
 }