diff options
author | Joachim Lingner <jl@openoffice.org> | 2001-11-22 12:03:09 +0000 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2001-11-22 12:03:09 +0000 |
commit | fb78143ca067f8e2468986c3743f9fa961253827 (patch) | |
tree | 7776f9cd25d62c2d3778e4207eaba153f0fd64df /stoc/test/javavm | |
parent | dee06d389c226eb3a863a10394b045d13d4f394d (diff) |
*** empty log message ***
Diffstat (limited to 'stoc/test/javavm')
-rw-r--r-- | stoc/test/javavm/testcomponent/TestComponent.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/stoc/test/javavm/testcomponent/TestComponent.java b/stoc/test/javavm/testcomponent/TestComponent.java index 58da78805f9d..a0fb1d01a858 100644 --- a/stoc/test/javavm/testcomponent/TestComponent.java +++ b/stoc/test/javavm/testcomponent/TestComponent.java @@ -2,6 +2,9 @@ import com.sun.star.comp.loader.FactoryHelper; import com.sun.star.lang.*; import com.sun.star.uno.*; import com.sun.star.registry.XRegistryKey; +import java.io.*; +import java.net.*; +import com.sun.star.lib.sandbox.*; /** This component implements XTypeProvider for use with StarBasic. @@ -52,6 +55,30 @@ public class TestComponent implements XServiceInfo, XTypeProvider prop= System.getProperty("http.nonProxyHosts"); prop= System.getProperty("socksProxyHost"); prop= System.getProperty("socksProxyPort"); + + prop= System.getProperty("stardiv.security.disableSecurity"); + prop= System.getProperty("appletviewer.security.mode"); + + // Test security settings + File f= new File("c:/temp/javasecurity.txt"); + try { + f.createNewFile(); + + // local connection + URL url= new URL("http://localhost:8080/index.html"); + InputStream is= url.openStream(); + // remote connection + url= new URL("http://www.w3.org/index.html"); + is= url.openStream(); + }catch( MalformedURLException mue) { + }catch( IOException e) { + String s= e.getMessage(); + System.out.println(s); + }catch( SandboxSecurityException sse) { + String s= sse.getMessage(); + System.out.println("s"); + } + return __serviceName; } // XServiceName @@ -97,4 +124,4 @@ public class TestComponent implements XServiceInfo, XTypeProvider TestComponent.__serviceName, regKey); } -}
\ No newline at end of file +} |