org.cruxframework.crux.scanner
Class URLStreamManager

java.lang.Object
  extended by org.cruxframework.crux.scanner.URLStreamManager

public class URLStreamManager
extends Object

Wrapper for handling the opening of URL input streams. Only necessary because of a buggy behavior of JarURLConnection, that keeps the lock of the jar file despite of we call urlInputStream.close().

Author:
Gesse Dafe

Constructor Summary
URLStreamManager(URL url)
          Creates a stream manager for a given URL.
 
Method Summary
static ByteArrayInputStream bufferedRead(URL url)
          Reads and stores a resource into memory
 void close()
          Closes the underlying input stream
 InputStream open()
          Opens the URL's stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLStreamManager

public URLStreamManager(URL url)
Creates a stream manager for a given URL.

Parameters:
url -
Method Detail

open

public InputStream open()
Opens the URL's stream

Returns:
Throws:
IOException

bufferedRead

public static ByteArrayInputStream bufferedRead(URL url)
Reads and stores a resource into memory

Returns:

close

public void close()
Closes the underlying input stream

Throws:
IOException


Copyright © 2015. All rights reserved.