public class JMpqEditor
extends java.lang.Object
implements java.lang.AutoCloseable
| Constructor and Description |
|---|
JMpqEditor(java.io.File mpqW)
Creates a new editor by parsing an exisiting mpq.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
deleteFile(java.lang.String name)
Deletes the specified file out of the mpq once you rebuild the mpq.
|
void |
extractAllFiles(java.io.File dest)
Extract all files.
|
void |
extractFile(java.lang.String name,
java.io.File dest)
Extracts the specified file out of the mpq to the target location.
|
void |
extractFile(java.lang.String name,
java.io.OutputStream dest)
Extracts the specified file out of the mpq and writes it to the target outputstream.
|
java.util.List<java.lang.String> |
getFileNames()
Gets the file names.
|
MpqFile |
getMpqFile(java.lang.String name)
Gets the mpq file.
|
int |
getTotalFileCount()
Gets the total file count.
|
boolean |
hasFile(java.lang.String name)
Checks for file.
|
void |
insertFile(java.lang.String name,
java.io.File f,
boolean backupFile)
Inserts the specified file into the mpq once you close the editor.
|
void |
printHeader()
Prints the header.
|
java.lang.String |
toString() |
public JMpqEditor(java.io.File mpqW)
throws JMpqException
mpqW - the mpq wJMpqException - if mpq is damaged or not supportedpublic void printHeader()
public void extractAllFiles(java.io.File dest)
throws JMpqException
dest - the destJMpqException - the j mpq exceptionpublic int getTotalFileCount()
throws JMpqException
JMpqException - the j mpq exceptionpublic void extractFile(java.lang.String name,
java.io.File dest)
throws JMpqException
name - name of the filedest - destination to that the files content is writtenJMpqException - if file is not found or access errors occurpublic boolean hasFile(java.lang.String name)
name - the namepublic java.util.List<java.lang.String> getFileNames()
public void extractFile(java.lang.String name,
java.io.OutputStream dest)
throws JMpqException
name - name of the filedest - the outputstream where the file's content is writtenJMpqException - if file is not found or access errors occurpublic MpqFile getMpqFile(java.lang.String name) throws java.io.IOException
name - the namejava.io.IOException - Signals that an I/O exception has occurred.public void deleteFile(java.lang.String name)
throws JMpqException
name - of the fileJMpqException - if file is not found or access errors occurpublic void insertFile(java.lang.String name,
java.io.File f,
boolean backupFile)
throws JMpqException
name - of the filef - the fbackupFile - if true the editors creates a copy of the file to add, so
further changes won't affect the resulting mpqJMpqException - if file is not found or access errors occurpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object