Esempio n. 1
0
 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;
   }
 }
Esempio n. 2
0
 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;
   }
 }