org.linkedin.util-core/src/main/java/org/linkedin/util/io/ram/RAMDirectory.java
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;
  }
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;
  }
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 ; }
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
Creates an empty directory and add it to this directory with this path ( equivalent to unix command ) : create all intermediary directories