     if result
       @assign result
       @$cfgPath = result.$cfgPath if result.$cfgPath
-      aContents = result.contents if result.contents
-      if aOptions.recursive and @isDirectory()
-        for vFile in aContents
-          vFile.loadSync aOptions if vFile.isDirectory()
+      if @isDirectory()
+        if result.contents #virtual folder
+          @convertVirtualFolder(result.contents)
+          aContents = result.contents
+        if aOptions.recursive
+          aContents = aContents.filter (f)->f.isDirectory()
+          for vFile in aContents
+            vFile.loadSync aOptions if vFile instanceof Resource
     result
 
   _getBufferSync: (aFile)->

    # TODO:whether export the non-enumerable $compiled attribute?
    result

  loadConfig: (aOptions, aContents, done)->
    that = @
    processCfg = (err, aConfig)->
      return done(err) if err
      if aConfig
        that.assign aConfig
        aContents = aConfig.contents if aConfig.contents
        if aOptions.recursive and that.isDirectory()
          aContents = aContents.filter (f)->f.isDirectory()
          Promise.map aContents, (f)->
            f.load aOptions
          .nodeify (err, result)->
            done(err, aConfig)
        else
          done(err, aConfig)
      else
        done(err, aConfig)
      return

    if !aOptions.stat.isDirectory()

File              = require 'custom-file/lib/advance'
inherits          = require 'inherits-ex/lib/inherits'
getPrototypeOf    = require 'inherits-ex/lib/getPrototypeOf'
setPrototypeOf    = require 'inherits-ex/lib/setPrototypeOf'
matter            = require 'front-matter-markdown/lib/'
loadCfgFile       = require 'load-config-file'
loadCfgFolder     = require 'load-config-folder'
extend            = require 'util-ex/lib/_extend'
isObject          = require 'util-ex/lib/is/type/object'
isString          = require 'util-ex/lib/is/type/string'
isArray           = require 'util-ex/lib/is/type/array'
defineProperty    = require 'util-ex/lib/defineProperty'
Promise           = require 'bluebird'
createFileObject  = require './create-file-object'
