Package org.xwiki.xar
Class XarFile
- java.lang.Object
-
- org.xwiki.xar.XarFile
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class XarFile extends Object implements Closeable
- Since:
- 5.4RC1
- Version:
- $Id: 17f58ed100c882ef30be7b6020e67ccea987a5a4 $
-
-
Constructor Summary
Constructors Constructor Description XarFile(File file)
XarFile(File file, Collection<XarEntry> pages)
XarFile(File file, XarPackage xarPackage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Collection<XarEntry>
getEntries()
XarEntry
getEntry(LocalDocumentReference reference)
File
getFile()
InputStream
getInputStream(LocalDocumentReference reference)
XarPackage
getXarPackage()
String
toString()
-
-
-
Constructor Detail
-
XarFile
public XarFile(File file) throws XarException, IOException
- Parameters:
file
- the XAR file- Throws:
XarException
- when failing parse the file (for example if it's not a valid XAR package)IOException
- when failing to read file
-
XarFile
public XarFile(File file, Collection<XarEntry> pages) throws XarException, IOException
- Parameters:
file
- the XAR filepages
- the pages in the XAR package- Throws:
XarException
- when failing parse the file (for example if it's not a valid XAR package)IOException
- when failing to read file
-
XarFile
public XarFile(File file, XarPackage xarPackage) throws XarException, IOException
- Parameters:
file
- the XAR filexarPackage
- the descriptor of the XAR package- Throws:
XarException
- when failing parse the file (for example if it's not a valid XAR package)IOException
- when failing to read file
-
-
Method Detail
-
getFile
public File getFile()
- Returns:
- the XAR file
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getInputStream
public InputStream getInputStream(LocalDocumentReference reference) throws IOException
- Parameters:
reference
- the reference of the page- Returns:
- an input stream to the page XML
- Throws:
IOException
- when failing to open a stream to the page XML
-
getEntries
public Collection<XarEntry> getEntries()
- Returns:
- the entries in the XAR file
-
getEntry
public XarEntry getEntry(LocalDocumentReference reference)
- Parameters:
reference
- the reference of the document- Returns:
- the XAR entry associated to a wiki document
-
getXarPackage
public XarPackage getXarPackage()
- Returns:
- the
XarPackage
- Since:
- 10.9
-
-