private final void import0(String improot,String dirname)
{
 File myroot=new File(dirname);
 if(!myroot.isDirectory()) return;

 if(dirname.length()>improot.length())
 {
   String urlpart;
   String hp;
   urlpart=dirname.substring(improot.length()+1);
   // roseknuti na host cast adresare a URL cast
   if(urlpart.indexOf(File.separator)==-1)
   {
     hp=urlpart;
     urlpart="";
   }
   else
   {
     hp=urlpart.substring(0,urlpart.indexOf(File.separator));
     urlpart=urlpart.substring(hp.length());
   }
   // extract hostname from filename
   String hn;
   hn=hp.toLowerCase();
   if(hn.indexOf('_')>-1)
      hn=hn.substring(0,hn.indexOf('_'));
   if(hn.indexOf('^')>-1)
      hn=hn.substring(0,hn.indexOf('^'));

   if(hn.indexOf('.')==-1)
    {
      System.out.println(new Date()+" [IMPORT] ignoring host without dot in name: "+hn);
      return;
     }
      // spocitat crc32 hash
      StringBuffer result;
      result=new StringBuffer(80);
      result.append(root);
      int ii;

      /* 1. spocitat hash z host stringu */
      java.util.zip.CRC32 crc=new CRC32();
      crc.update(hn.getBytes());
      /* mame hash - rozdelime ho na adresar */
      long unit=((long)1<<32)/(mgr.swap_level1_dirs*mgr.swap_level2_dirs);
      ii=(int)(crc.getValue()/unit);
      /* zacneme budovat cestu */
      result.append(File.separator+(ii/mgr.swap_level2_dirs)+File.separator+(ii-mgr.swap_level1_dirs*(ii/mgr.swap_level2_dirs))+File.separator+hp+urlpart+File.separator);

   cachedir imp,my;
   /* create .cacheinfo in to-be-imported directory */
   imp=repair.repairDir(dirname,false);
   my=new cachedir(result.toString(),null);
   // System.out.println("hp="+hp+"("+hn+") urlpart="+urlpart+" mydir="+result);
   my.merge(imp);
   my.save();
 }

 // into subdirz
 String filez[];
 filez=myroot.list();
 if(filez==null) return;
 for(int i=filez.length-1;i>=0;i--)
  if(new File(dirname+File.separator+filez[i]).isDirectory()) import0(improot,dirname+File.separator+filez[i]);

}