public synchronized void setPath(String path) { String old = this.path; this.path = path; for (ResourceObserver obs:observers) obs.changedPath(old); adjustChildrenPath(); }
public synchronized void setPath(String path) { String old = this.path; this.path = path; for (ResourceObserver obs:observers) obs.changedPath(old); adjustChildrenPath(); }
public void setParent(Resource parent) { this.parent = parent; if (parent != null) this.path = parent.getPath() + parent.getName() + "/"; adjustChildrenPath(); }
public void setParent(Resource parent) { this.parent = parent; if (parent != null) this.path = parent.getPath() + parent.getName() + "/"; adjustChildrenPath(); }
public synchronized void setName(String name) { if (name == null) throw new NullPointerException(); String old = this.name; // adjust parent if in tree Resource parent = getParent(); if (parent!=null) { synchronized (parent) { parent.delete(this); this.name = name; parent.add(this); } } else { this.name = name; } adjustChildrenPath(); for (ResourceObserver obs:observers) obs.changedName(old); }
public synchronized void setName(String name) { if (name == null) throw new NullPointerException(); String old = this.name; // adjust parent if in tree Resource parent = getParent(); if (parent!=null) { synchronized (parent) { parent.delete(this); this.name = name; parent.add(this); } } else { this.name = name; } adjustChildrenPath(); for (ResourceObserver obs:observers) obs.changedName(old); }