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
注:必须按照那两种要求。 谢谢各位大虾了!本人新手,尚未实践,这是刚开始尝试,希望大家多多指教! 希望各位能给我个稍微详细点的代码以作参考!谢谢本人在线等候
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
注:必须按照那两种要求。 谢谢各位大虾了!本人新手,尚未实践,这是刚开始尝试,希望大家多多指教! 希望各位能给我个稍微详细点的代码以作参考!谢谢本人在线等候
<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?把结果写出来看看...
刚吃饭去了,不好意思哈
下面就是我想要的,用两个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
<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/"
我的MSN是:[email protected] 刚我发了封信给你。恳请赐教呀!
我有个**.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
请问,这样子行不行?能看懂了吗?