public final class MainModel extends Object
| Constructor and Description |
|---|
MainModel()
Instantiates a new main model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(File file,
String targetName,
File archiveFile)
Add the specified file to the combine archive as
targetName. |
void |
closeArchive(File archiveFile)
Closes the specified archive file.
|
void |
createArchive(File archiveFile)
Creates the archive.
|
void |
extractArchive(File destination,
File archiveFile)
Extracts the complete combine archive to the specified destination file.
|
void |
extractArchiveEntries(File destination,
File archiveFile,
Collection<de.unirostock.sems.cbarchive.ArchiveEntry> archiveEntries)
Extracts the specified subset of
ArchiveEntries from the
specified combine archive to destination. |
Collection<File> |
getArchives()
XXX - needed?.
|
List<de.unirostock.sems.cbarchive.ArchiveEntry> |
listEntries(File archiveFile)
Retrieves the entries of the combine archive.
|
void |
moveArchiveEntriesToArchive(File fromArchive,
List<de.unirostock.sems.cbarchive.ArchiveEntry> entries,
File toArchive,
String newPath)
Move archive entries to archive.
|
void |
moveArchiveEntry(File archive,
de.unirostock.sems.cbarchive.ArchiveEntry entry,
String newPath)
Move archive entry.
|
void |
openArchive(File archiveFile)
Opens a combine archive files using combine archive java library.
|
public void createArchive(File archiveFile) throws Exception
archiveFile - the archive fileException - the exceptionpublic void openArchive(File archiveFile) throws IOException, org.jdom2.JDOMException, ParseException, de.unirostock.sems.cbarchive.CombineArchiveException
archiveFile - the archive fileIOException - Signals that an I/O exception has occurred.org.jdom2.JDOMException - the jDOM exceptionParseException - the parse exceptionde.unirostock.sems.cbarchive.CombineArchiveException - the combine archive exceptionpublic Collection<File> getArchives()
public void closeArchive(File archiveFile) throws IOException, TransformerException
archiveFile - the archive fileIOException - Signals that an I/O exception has occurred.TransformerException - the transformer exceptionpublic void extractArchive(File destination, File archiveFile) throws IOException
destination is a directory, then all files are extracted
into this directory. Otherwise, the files are extracted into the same
directory as destination.destination - - folder/file, files are extracted toarchiveFile - - combine archive fileIOException - Signals that an I/O exception has occurred.public void extractArchiveEntries(File destination, File archiveFile, Collection<de.unirostock.sems.cbarchive.ArchiveEntry> archiveEntries) throws IOException
ArchiveEntries from the
specified combine archive to destination.
XXX - allow access via ArchiveEntry? what about string and then using
getEntry(String location)?destination - the destinationarchiveFile - the archive filearchiveEntries - the archive entriesIOException - Signals that an I/O exception has occurred.public void addFile(File file, String targetName, File archiveFile) throws IOException, TransformerException
targetName.file - the filetargetName - the target namearchiveFile - the archive fileIOException - Signals that an I/O exception has occurred.TransformerException - the transformer exceptionpublic void moveArchiveEntry(File archive, de.unirostock.sems.cbarchive.ArchiveEntry entry, String newPath) throws IOException, TransformerException
archive - the archiveentry - the entrynewPath - the new pathIOException - Signals that an I/O exception has occurred.TransformerException - the transformer exceptionpublic void moveArchiveEntriesToArchive(File fromArchive, List<de.unirostock.sems.cbarchive.ArchiveEntry> entries, File toArchive, String newPath) throws IOException, TransformerException
fromArchive - the from archiveentries - the entriestoArchive - the to archivenewPath - the new pathIOException - Signals that an I/O exception has occurred.TransformerException - the transformer exceptionCopyright © 2014. All rights reserved.