Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1.     @Test
  2.     @TestForIssue(jiraKey = "HHH-6806")
  3.     public void testJarVisitorFactory() throws Exception {
  4.  
  5.         // setting URL to accept vfs based protocol
  6.         URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory() {
  7.             public URLStreamHandler createURLStreamHandler(String protocol) {
  8.                 if ("vfszip".equals(protocol) || "vfsfile".equals(protocol))
  9.                     return new URLStreamHandler() {
  10.                         protected URLConnection openConnection(URL u) throws IOException {
  11.                             return null;
  12.                         }
  13.                     };
  14.                 return null;
  15.             }
  16.         });
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement