code: private String getStreamDirectory(IScope scope) {
          final StringBuilder result = new StringBuilder();
          final IScope app = ScopeUtils.findApplication(scope);
          final String prefix = "streams/";
          while (scope != null && scope != app) {
              result.insert(0, scope.getName() + "/");
              scope = scope.getParent();
          }
          if (result.length() == 0) {
              return prefix;
          } else {
              result.insert(0, prefix).append('/');
              return result.toString();
          }
      }
docs: Generate stream directory based on relative scope path. The base directory is
  
  <pre>
  streams
  </pre>
  
  , e.g. a scope
  
  <pre>
  /application/one/two/
  </pre>
  
  will generate a directory
  
  <pre>
  /streams/one/two/
  </pre>
  
  inside the application.
  
  @param scope
  Scope
  @return Directory based on relative scope path