Package java.util.zip

Examples of java.util.zip.ZipException.initCause()


          throw (IOException) e.getException();
        throw (RuntimeException) e.getException();
      }
    } catch (ZipException e) {
      ZipException zipNameException = new ZipException("Exception in opening zip file: " + file.getPath()); //$NON-NLS-1$
      zipNameException.initCause(e);
      throw zipNameException;
    } catch (IOException e) {
      IOException fileNameException = new IOException("Exception in opening zip file: " + file.getPath()); //$NON-NLS-1$
      fileNameException.initCause(e);
      throw fileNameException;
View Full Code Here


          throw (IOException) e.getException();
        throw (RuntimeException) e.getException();
      }
    } catch (ZipException e) {
      ZipException zipNameException = new ZipException("Exception in opening zip file: " + file.getPath()); //$NON-NLS-1$
      zipNameException.initCause(e);
      throw zipNameException;
    } catch (IOException e) {
      IOException fileNameException = new IOException("Exception in opening zip file: " + file.getPath()); //$NON-NLS-1$
      fileNameException.initCause(e);
      throw fileNameException;
View Full Code Here

            if (magicBytes != 0x504b0304) {
                throw new IOException(String.format("Wrong magic bytes of %x for zip file %s of %d bytes", magicBytes, file,
                        file.length()));
            }
            ZipException e2 = new ZipException("Error opening zip file " + file + " of " + file.length() + " bytes");
            e2.initCause(e);
            throw e2;
        }
    }

    @Override
View Full Code Here

        catch( ZipException e )
        {
            // since the current ZipException gives no indication what jar file is corrupted
            // we prefer to wrap another ZipException for better error visibility
            ZipException ze = new ZipException( "Cannot process Jar entry on URL: " + url + " due to " + e.getMessage() );
            ze.initCause( e );
            throw ze;
        }

        return visitor.getClasses();
    }
View Full Code Here

        catch( ZipException e )
        {
            // since the current ZipException gives no indication what jar file is corrupted
            // we prefer to wrap another ZipException for better error visibility
            ZipException ze = new ZipException( "Cannot process Jar entry on URL: " + url + " due to " + e.getMessage() );
            ze.initCause( e );
            throw ze;
        }

        return visitor.getClasses();
    }
View Full Code Here

            this.jarFile = new JarFile( file );
        }
        catch ( ZipException e )
        {
            ZipException ioe = new ZipException( "Failed to open file " + file + " : " + e.getMessage() );
            ioe.initCause( e );
            throw ioe;
        }

        // Obtain entries list.
        List entries = Collections.list( jarFile.entries() );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.