Code example for ConnectException

0
                Logger.warn(IOUtil.class, 
                            "Could not download Url '%1$s'. Server responded %2$s - %3$s.", 
                            pUrl,
                            pUrlConnection.getResponseCode(),
                            pUrlConnection.getResponseMessage());
                throw new ConnectException();
            } 
        } else { 
            Logger.warn(IOUtil.class, "Url was redirected from '%1$s' to host %2$s.", pUrl.getHost(), pUrlConnection.getURL());
            throw new ConnectException();
        } 
    } 
 
    // TODO Remove files if unzipping fails and notify error. 
    // TODO Remove original zip file after decompression. 
    public static void unzipFileToDirectory(File pFile, File pToDirectory) throws FileNotFoundException, IOException {
        ZipInputStream zipInputStream = null;
        if (pToDirectory == null || !pToDirectory.isDirectory()) {
            throw new InvalidDirectoryException(pToDirectory);
        }