code: public static ComponentManager initialize(File permanentDirectory, File resourceDirectory)
      {
          return initialize(permanentDirectory, resourceDirectory, null);
      }
docs: Initialize the full XWiki system (ie Component Manager and Environment), using the class loader that loaded
  this class and using the "java.io.tmpdir" System property value as the temporary diretory location.
  
  @param permanentDirectory see {@link org.xwiki.environment.Environment#getPermanentDirectory()}
  @param resourceDirectory see
  {@link org.xwiki.environment.internal.StandardEnvironment#setResourceDirectory(java.io.File)}
  @return the initialized Component Manager
  @see #dispose(ComponentManager)