code: public RAMDirectory mkdirhier(String path) throws IOException
    {
      RAMDirectory directory = this;
  
      String[] pathComponents = path.split("/");
  
      for(String pathComponent : pathComponents)
      {
        // we skip empty path components (caused by leading / + double //)
        if(pathComponent.equals(""))
          continue;
  
        RAMEntry entry = directory.getEntry(pathComponent);
  
        if(entry == null)
        {
          directory = directory.mkdir(pathComponent);
        }
        else
        {
          if(entry instanceof RAMDirectory)
          {
            directory = (RAMDirectory) entry;
          }
          else
          {
            throw new IOException("File exists: " + pathComponent);
          }
        }
      }
  
      return directory;
    }
docs: Creates an empty directory and add it to this directory with this path (equivalent
  to unix command): create all intermediary directories
  
  @param path
  @return the created directory