ResFileDecoder: continue on exception.

This commit is contained in:
Ryszard Wiśniewski 2010-06-01 11:52:06 +02:00
parent 620b71abd3
commit e4ecd30a27
2 changed files with 10 additions and 9 deletions

View File

@ -23,6 +23,8 @@ import brut.directory.DirectoryException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
@ -71,17 +73,20 @@ public class ResFileDecoder {
in.close();
out.close();
} catch (AndrolibException ex) {
throw new AndrolibException(String.format(
LOGGER.log(Level.SEVERE, String.format(
"Could not decode file \"%s\" to \"%s\"",
inFileName, outFileName), ex);
} catch (IOException ex) {
throw new AndrolibException(String.format(
LOGGER.log(Level.SEVERE, String.format(
"Could not decode file \"%s\" to \"%s\"",
inFileName, outFileName), ex);
} catch (DirectoryException ex) {
throw new AndrolibException(String.format(
LOGGER.log(Level.SEVERE, String.format(
"Could not decode file \"%s\" to \"%s\"",
inFileName, outFileName), ex);
}
}
private final static Logger LOGGER =
Logger.getLogger(ResFileDecoder.class.getName());
}

View File

@ -19,7 +19,6 @@ package brut.androlib.res.decoder;
import brut.androlib.AndrolibException;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.xmlpull.v1.*;
import org.xmlpull.v1.wrapper.*;
@ -51,15 +50,12 @@ public class XmlPullStreamDecoder implements ResStreamDecoder {
in.close();
out.close();
} catch (XmlPullParserException ex) {
LOGGER.log(Level.SEVERE, "Could not decode XML", ex);
throw new AndrolibException("Could not decode XML", ex);
} catch (IOException ex) {
LOGGER.log(Level.SEVERE, "Could not decode XML", ex);
throw new AndrolibException("Could not decode XML", ex);
}
}
private final XmlPullParser mParser;
private final XmlSerializer mSerial;
private final static Logger LOGGER =
Logger.getLogger(XmlPullStreamDecoder.class.getName());
}