public class XarFile extends Object implements Closeable
Constructor and Description |
---|
XarFile(File file) |
XarFile(File file,
Collection<XarEntry> pages) |
XarFile(File file,
XarPackage xarPackage) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Collection<XarEntry> |
getEntries() |
XarEntry |
getEntry(LocalDocumentReference reference) |
File |
getFile() |
InputStream |
getInputStream(LocalDocumentReference reference) |
XarPackage |
getXarPackage() |
String |
toString() |
public XarFile(File file) throws XarException, IOException
file
- the XAR fileXarException
- when failing parse the file (for example if it's not a valid XAR package)IOException
- when failing to read filepublic XarFile(File file, Collection<XarEntry> pages) throws XarException, IOException
file
- the XAR filepages
- the pages in the XAR packageXarException
- when failing parse the file (for example if it's not a valid XAR package)IOException
- when failing to read filepublic XarFile(File file, XarPackage xarPackage) throws XarException, IOException
file
- the XAR filexarPackage
- the descriptor of the XAR packageXarException
- when failing parse the file (for example if it's not a valid XAR package)IOException
- when failing to read filepublic File getFile()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public InputStream getInputStream(LocalDocumentReference reference) throws IOException
reference
- the reference of the pageIOException
- when failing to open a stream to the page XMLpublic Collection<XarEntry> getEntries()
public XarEntry getEntry(LocalDocumentReference reference)
reference
- the reference of the documentpublic XarPackage getXarPackage()
XarPackage
Copyright © 2004–2022 XWiki. All rights reserved.