Laplandia / owaspantisamy

Automatically exported from code.google.com/p/owaspantisamy
0 stars 0 forks source link

System.IO.StreamReader Constructor for Policy (Patch Included) #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To simplify deployment we store our policy files as embedded resources in
the DLL. However the current Policy does not support reading Policy files
either from a string or a stream. Attached is a patch to Policy.cs that
will construct a Policy object given a StreamReader. This required some
slight re-organisation of the Policy file to move XML parsing into its own
method (Initialise) which is called by the constructors.

Given this patch it is possible to read the policy from the assembly with;
System.Reflection.Assembly asm = typeof(MyClass).Assembly;
System.IO.Stream stream = asm.GetManifestResourceStream("MyClass.Policy");
Policy policy = Policy.getInstance(new System.IO.StreamReady(stream)

The patch provided is against the current head (R72)

Original issue reported on code.google.com by Mr.M.Dav...@gmail.com on 18 Jan 2009 at 10:33

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by arshan.d...@gmail.com on 20 Jan 2009 at 4:35

GoogleCodeExporter commented 9 years ago
This is a really useful patch, I'd like to see it applied.

Original comment by arnout.engelen on 13 Aug 2010 at 11:59

GoogleCodeExporter commented 9 years ago
We don't officially maintain the .NET port anymore and it should be considered 
"as is" until developers come along that want to take ownership.

Original comment by arshan.d...@gmail.com on 15 Nov 2010 at 10:04