RT,,,,,我有一个   *.conf 的文件(其实本人觉得,什么类型的文件都无所谓) 这个文件里面  包含有许多数据其中就有多种这样的数据 <Directory "/a04_01/intranet/docs">
    Options All
    AllowOverride All
    Order allow,deny
    Allow from all
    #Require valid-user
</Directory>Alias /icons/ "/usr/share/apache2/icons/"
然后,问题就来了,用HashMap,以这种形式存放数据Map Entry
 Value
 
/a04_01/intranet/docs/itc/
 polyu_staff_ft,polyu_staff_pt,polyu_stud
 
/a04_01/it/shuttle/public_html/monitor/int_statistics/
 polyu_ITS,polyu_funct_ITS
 
 这儿呢,解释下,第一行,要求是按照Directory读取存放的,                                第二行,要求是按照Alias 读取存放的。 然后,我想要的System Out (输出)的形式为/a04_01/intranet/docs/itc/       polyu_staff_ft,polyu_staff_pt,polyu_stud
/a04_01/it/shuttle/public_html/monitor/int_statistics/    polyu_ITS,polyu_funct_ITS
 
注:必须按照那两种要求。 谢谢各位大虾了!本人新手,尚未实践,这是刚开始尝试,希望大家多多指教! 希望各位能给我个稍微详细点的代码以作参考!谢谢本人在线等候

解决方案 »

  1.   

    我大致明白你的意思,但是还不够具体,比如你给的这个例子:
    <Directory "/a04_01/intranet/docs"> 
        Options All 
        AllowOverride All 
        Order allow,deny 
        Allow from all 
        #Require valid-user 
    </Directory> Alias /icons/ "/usr/share/apache2/icons/"这组数据你要得出什么样的 HashMap?把结果写出来看看...
      

  2.   


    刚吃饭去了,不好意思哈
    下面就是我想要的,用两个HashMap集合,一个的key装Directory,一个key装Alias,而这两个的值,在读取的文件里面有很多,所以都要列出来,而他们的value就更是一样了,也很多。Map Entry Value
    /a04_01/intranet/docs/itc/ polyu_staff_ft,polyu_staff_pt,polyu_stud
    /a04_01/it/shuttle/public_html/monitor/int_statistics/ polyu_ITS,polyu_funct_ITS上面这个就是我想要的HashMap的样子,而打印他们呢,用\t制表,得出下面的形式:
    /a04_01/intranet/docs/itc/ polyu_staff_ft,polyu_staff_pt,polyu_stud
    /a04_01/it/shuttle/public_html/monitor/int_statistics/ polyu_ITS,polyu_funct_ITS
      

  3.   

    我想你没明白我问题的意思,因为从下面这个文本,我得不到你要的这个map  比如polyu_staff_ft是从哪里来的?
    <Directory "/a04_01/intranet/docs"> 
        Options All 
        AllowOverride All 
        Order allow,deny 
        Allow from all 
        #Require valid-user 
    </Directory> Alias /icons/ "/usr/share/apache2/icons/" 
      

  4.   

    额,你有没有MSN? 加我,我给你所有资料,这样就明白多了!
      

  5.   


    我的MSN是:[email protected]  刚我发了封信给你。恳请赐教呀!
      

  6.   

    基本不怎么上 现在公司查的紧 你能稍微再稍微描述清楚点么大致的流程我想就是io读文件,然后判断关键字,最后输出到map中去
      

  7.   


    我有个**.conf的文件,里面好很多<Directory "/a04_01/intranet/docs">
        Options All
        AllowOverride All
        Order allow,deny
        Allow from all
        #Require valid-user
    </Directory>Alias /icons/ "/usr/share/apache2/icons/"不止一个,内容也不同,而我的目的,就是为了将这些东西都按照两种形式找出来,用HashMap做,一种就是Directory,一种就是Alias,**.conf文件里所有以这两种方式的内容,都读取出来,而那个值,则是polyu_staff_ft一类的,它可能在**.conf里面只按照Directory找,也可能按照Alias找,也可能两种都有。
    所以:1. Develop a java function to convert the ACL file to ACL mapping for each resource path.
    1.1. Convert the configuration in the file to a HashMap of resource path and ACL. For example:
    Map Entry Value
    /a04_01/intranet/docs/itc/ polyu_staff_ft,polyu_staff_pt,polyu_stud
    /a04_01/it/shuttle/public_html/monitor/int_statistics/ polyu_ITS,polyu_funct_ITS
    According to the ACL file, there are 2 types of configuration.
    1.1.1. By Directory
    The information is in the directory tag.
    1.1.2. By Alias
    The path is set under alias. The ACL is included in a separate Location tag.1.2. List the output of the HashMap in SystemOut like the followings:
    /a04_01/intranet/docs/itc/ polyu_staff_ft,polyu_staff_pt,polyu_stud
    /a04_01/it/shuttle/public_html/monitor/int_statistics/ polyu_ITS,polyu_funct_ITS
    请问,这样子行不行?能看懂了吗?