public static String getDecompressedFileName(File file) throws IOException {
        String fileName = file.getName();
        ZipFile zipFile = null;


        try {
            // get file as input stream
            if (isGzipped(file)) {
                String compressedFileName = file.getName();
                fileName = compressedFileName.substring(0, compressedFileName.length() - 3);
            } else if (isZipped(file) && file.exists() && file.canRead()) {
                zipFile = new ZipFile(file);
                Enumeration<? extends ZipEntry> entries = zipFile.entries();
                // read only the first entry from zip
                if (entries.hasMoreElements()) {
                    ZipEntry entry = entries.nextElement();
                    fileName = entry.getName();
                }
            }
        } finally {
            if (zipFile != null) {
                zipFile.close();
            }
        }

        return getRealFileName(fileName);
    }