public static String getAdditionalPath(NamespaceNotification notification) { switch (EventType.fromByteValue(notification.getType())) { case FILE_ADDED: return notification.path.substring( notification.path.lastIndexOf('/') + 1, notification.path.length()); default: return null; } }
public static String getBasePath(NamespaceNotification notification) { switch (EventType.fromByteValue(notification.getType())) { case FILE_ADDED: String basePath = notification.path.substring(0, notification.path.lastIndexOf('/')); if (basePath.trim().length() == 0) { return "/"; } return basePath; case FILE_CLOSED: case NODE_DELETED: return notification.path; default: return null; } }