From 5f7e37d7b26832b3b512f9dda310cb9bc92c93fb Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Fri, 27 Dec 2019 21:08:44 +0100 Subject: Create new zones with UpdateAttributes message --- src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/model') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java b/src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java index 7f2f604..54fbf43 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/model/ZMI.java @@ -111,6 +111,23 @@ public class ZMI implements Cloneable, Serializable { return descendant; } + public boolean descendantExists(PathName path) { + try { + findDescendant(path); + return true; + } catch (NoSuchZoneException e) { + return false; + } + } + + /* + * Convenient version of findDescendant that takes String representation of + * path. + */ + public ZMI findDescendant(String pathString) throws NoSuchZoneException { + return findDescendant(new PathName(pathString)); + } + /** * Gets the list of sons of this ZMI. Modifying a value in the returned list will cause an exception. * -- cgit v1.2.3