I looked a bit at commons compress, I'd like to make a couple suggestions:
- FileOutputStream and FileInputStream are used in several method
signatures, but a simple OutputStream or InputStream would do the job.
It's limiting the API to files only for no apparent reason.
- I believe it would make sense if the exception hierarchy extend
IOException. It could simplify some exception handling in the code, for
example in PackableObject instead of this:
public static PackableObject identifyByHeader(File file, List
packables) throws PackableObjectException {
...
try {
...
} catch (FileNotFoundException e) {
throw new PackableObjectException("File not found", e);
} catch (IOException e) {
throw new PackableObjectException("Internal factory
exception", e);
} finally {
try {
fis.close();
} catch (IOException e1) {
throw new PackableObjectException("Error while closing
InputStream to file", e1);
}
}
}
we could have this:
public static PackableObject identifyByHeader(File file, List
packables) throws IOException {
...
try {
...
} finally {
fis.close();
}
}
Any objection to change this ?
Emmanuel Bourg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]