class FileWriter {

    public void write(final InputStream inputStream, final String fileName, final String exceptionMessage) {
        boolean isClass = fileName.endsWith(".class");
        boolean isJar = fileName.endsWith(".jar");
        if (isClass) {
            writeClass(fileName, inputStream, exceptionMessage);
        } else if (isJar) {
            writeJar(fileName, inputStream, exceptionMessage);
        } else {
            writeOther(fileName, inputStream, exceptionMessage);
        }
    }

}