org.xwiki.extension.repository.internal.core
Class DefaultCoreExtensionFile

java.lang.Object
  extended by org.xwiki.extension.repository.internal.core.DefaultCoreExtensionFile
All Implemented Interfaces:
CoreExtensionFile, ExtensionFile

public class DefaultCoreExtensionFile
extends Object
implements CoreExtensionFile

Default implementation of CoreExtensionFile.

Since:
4.0M1

Constructor Summary
DefaultCoreExtensionFile(URL url)
           
 
Method Summary
 long getLength()
           
 URL getURL()
           
 InputStream openStream()
          Open an input stream to allows reading the extensions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCoreExtensionFile

public DefaultCoreExtensionFile(URL url)
Parameters:
url - the URL of the core extension
Method Detail

getLength

public long getLength()
Specified by:
getLength in interface ExtensionFile
Returns:
the size of the extension file, -1 if not provided

openStream

public InputStream openStream()
                       throws IOException
Description copied from interface: ExtensionFile
Open an input stream to allows reading the extensions.

Note that it's up to the user of this method to close the stream.

Specified by:
openStream in interface ExtensionFile
Returns:
the stream to read
Throws:
IOException - error when opening the stream

getURL

public URL getURL()
Specified by:
getURL in interface CoreExtensionFile
Returns:
the core extension URL