|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.kirkwarez.cheezefix.CheezeFix
public class CheezeFix
This class can fix wiremod MDL files by cheeze, which fixes the console error spam.
Field Summary | |
---|---|
protected boolean |
backup
Whether or not to back up files before they are fixed. |
static java.util.regex.Pattern |
cheezePattern
The pattern of the mdlkeyvalue section in cheeze's MDL files. |
protected int |
fixedMDLCount
The amount of MDL files fixed. |
static java.util.regex.Pattern |
mkvPattern
The pattern of the mdlkeyvalue section. |
protected int |
skippedMDLCount
The amount of MDL files skipped. |
protected int |
skippedNonExistingCount
The amount of non-existing files skipped. |
protected int |
skippedNonMDLCount
The amount of non-MDL files skipped. |
Constructor Summary | |
---|---|
CheezeFix(boolean backup)
Constructs a new CheezeFix . |
Method Summary | |
---|---|
void |
fix(java.io.File file)
Fixes the given file or the contents of the given directory (recursively). |
protected byte[] |
fixData(byte[] data)
Inspects the given data, and fixes it if possible. |
protected void |
fixDir(java.io.File dir)
Fixes the contents of the given directory (recursively). |
protected void |
fixFile(java.io.File file)
Fixes the given file. |
int |
getFixedMDLCount()
Returns the fixed MDL files count. |
int |
getSkippedMDLCount()
Returns the skipped MDL files count. |
int |
getSkippedNonExistingCount()
Returns the skipped non-existing files count. |
int |
getSkippedNonMDLCount()
Returns the skipped non-MDL files count. |
static void |
main(java.lang.String[] args)
Fixes the given wiremod MDL files by cheeze, which fixes the console error spam. |
protected byte[] |
readFile(java.io.File file)
Reads a file into an array. |
protected void |
writeFile(java.io.File file,
byte[] data)
Writes an array into a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean backup
protected int fixedMDLCount
protected int skippedMDLCount
protected int skippedNonMDLCount
protected int skippedNonExistingCount
public static java.util.regex.Pattern mkvPattern
public static java.util.regex.Pattern cheezePattern
Constructor Detail |
---|
public CheezeFix(boolean backup)
CheezeFix
.
backup
- Whether or not to back up files before they are fixed.Method Detail |
---|
public void fix(java.io.File file)
file
- The file to fix, or the directory to fix the contents of.protected void fixDir(java.io.File dir)
dir
- The directory to fix the contents of.protected void fixFile(java.io.File file)
file
- The file to fix.protected byte[] readFile(java.io.File file) throws java.io.IOException
file
- The file to read.
java.io.IOException
- If a reading error occurs.protected void writeFile(java.io.File file, byte[] data) throws java.io.IOException
file
- The file to write to.data
- The data to write.
java.io.IOException
- If a writing error occurs.protected byte[] fixData(byte[] data)
data
- The data to fix.
null
if the data is fine or could not be
fixed.public int getFixedMDLCount()
public int getSkippedMDLCount()
public int getSkippedNonMDLCount()
public int getSkippedNonExistingCount()
public static void main(java.lang.String[] args)
args
- The commandline parameters, which should be files and directories.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |