public class ViewArchiveUtility extends Object
Constructor and Description |
---|
ViewArchiveUtility() |
Modifier and Type | Method and Description |
---|---|
File |
getFile(String path)
Get a new file instance for the given path.
|
FileOutputStream |
getFileOutputStream(File file)
Get a new file output stream for the given file.
|
JarInputStream |
getJarFileStream(File file)
Get a new jar file stream from the given file.
|
ViewConfig |
getViewConfigFromArchive(File archiveFile)
Get the view configuration from the given archive file.
|
ViewConfig |
getViewConfigFromExtractedArchive(String archivePath,
boolean validate)
Get the view configuration from the extracted archive file.
|
protected void |
validateConfig(InputStream configStream)
Validate the given view descriptor file against the view schema.
|
public ViewConfig getViewConfigFromArchive(File archiveFile) throws JAXBException, IOException
archiveFile
- the archive fileJAXBException
- if xml is malformedIOException
public ViewConfig getViewConfigFromExtractedArchive(String archivePath, boolean validate) throws JAXBException, IOException, SAXException
archivePath
- path to extracted archivevalidate
- indicates whether or not the view configuration should be validatedJAXBException
- if xml is malformedIOException
- if xml can not be readSAXException
- if the validation failspublic File getFile(String path)
path
- the pathpublic FileOutputStream getFileOutputStream(File file) throws FileNotFoundException
file
- the fileFileNotFoundException
public JarInputStream getJarFileStream(File file) throws IOException
file
- the fileIOException
protected void validateConfig(InputStream configStream) throws SAXException, IOException
configStream
- input stream of view descriptor file to be validatedSAXException
- if the validation failsIOException
- if the descriptor file can not be readCopyright © 2022 Apache Software Foundation. All rights reserved.