Examples of ArchiveException


Examples of org.apache.commons.compress.archivers.ArchiveException

        in = new DataInputStream(inputStream);
        this.charsetName = charsetName;
        try {
            mainHeader = readMainHeader();
            if ((mainHeader.arjFlags & MainHeader.Flags.GARBLED) != 0) {
                throw new ArchiveException("Encrypted ARJ files are unsupported");
            }
            if ((mainHeader.arjFlags & MainHeader.Flags.VOLUME) != 0) {
                throw new ArchiveException("Multi-volume ARJ files are unsupported");
            }
        } catch (IOException ioException) {
            throw new ArchiveException(ioException.getMessage(), ioException);
        }
    }
View Full Code Here

Examples of org.apache.commons.compress.archivers.ArchiveException

            // skip past CLRI and BITS segments since we don't handle them yet.
            readCLRI();
            readBITS();
        } catch (IOException ex) {
            throw new ArchiveException(ex.getMessage(), ex);
        }

        // put in a dummy record for the root node.
        Dirent root = new Dirent(2, 2, 4, ".");
        names.put(Integer.valueOf(2), root);
View Full Code Here

Examples of org.apache.commons.compress.archivers.ArchiveException

            // skip past CLRI and BITS segments since we don't handle them yet.
            readCLRI();
            readBITS();
        } catch (IOException ex) {
            throw new ArchiveException(ex.getMessage(), ex);
        }

        // put in a dummy record for the root node.
        Dirent root = new Dirent(2, 2, 4, ".");
        names.put(Integer.valueOf(2), root);
View Full Code Here

Examples of org.hibernate.jpa.boot.archive.spi.ArchiveException

        final InputStreamAccess inputStreamAccess;
        try {
          inputStreamAccess = buildByteBasedInputStreamAccess( name, jarFile.getInputStream( zipEntry ) );
        }
        catch (IOException e) {
          throw new ArchiveException(
              String.format(
                  "Unable to access stream from jar file [%s] for entry [%s]",
                  jarFile.getName(),
                  zipEntry.getName()
              )
          );
        }

        final ArchiveEntry entry = new ArchiveEntry() {
          @Override
          public String getName() {
            return name;
          }

          @Override
          public String getNameWithinArchive() {
            return relativeName;
          }

          @Override
          public InputStreamAccess getStreamAccess() {
            return inputStreamAccess;
          }
        };
        context.obtainArchiveEntryHandler( entry ).handleEntry( entry, context );
      }
    }
    catch (IOException e) {
      throw new ArchiveException( "Error accessing jar file [" + rootFile.getAbsolutePath() + "]", e );
    }
  }
View Full Code Here

Examples of org.hibernate.jpa.boot.archive.spi.ArchiveException

  public static byte[] getBytesFromInputStreamSafely(InputStream inputStream) throws ArchiveException {
    try {
      return getBytesFromInputStream( inputStream );
    }
    catch (IOException e) {
      throw new ArchiveException( "Unable to extract bytes from InputStream", e );
    }
  }
View Full Code Here

Examples of org.hibernate.jpa.boot.archive.spi.ArchiveException

            finally {
              subJarInputStream.close();
            }
          }
          catch (Exception e) {
            throw new ArchiveException( "Error accessing nested jar", e );
          }
        }
        else {
          final String entryName = extractName( jarEntry );
          final InputStreamAccess inputStreamAccess
              = buildByteBasedInputStreamAccess( entryName, jarInputStream );

          final String relativeName = extractRelativeName( jarEntry );

          final ArchiveEntry entry = new ArchiveEntry() {
            @Override
            public String getName() {
              return entryName;
            }

            @Override
            public String getNameWithinArchive() {
              return relativeName;
            }

            @Override
            public InputStreamAccess getStreamAccess() {
              return inputStreamAccess;
            }
          };

          context.obtainArchiveEntryHandler( entry ).handleEntry( entry, context );
        }
      }

      jarInputStream.close();
    }
    catch (IOException ioe) {
      throw new ArchiveException(
          String.format( "Error accessing JarInputStream [%s]", getArchiveUrl() ),
          ioe
      );
    }
  }
View Full Code Here

Examples of org.hibernate.jpa.boot.archive.spi.ArchiveException

    final DataInputStream dataInputStream = new DataInputStream( inputStream );
    try {
      return new ClassFile( dataInputStream );
    }
    catch (IOException e) {
      throw new ArchiveException( "Could not build ClassFile" );
    }
    finally {
      try {
        dataInputStream.close();
      }
View Full Code Here

Examples of org.hibernate.jpa.boot.archive.spi.ArchiveException

          finally {
            is.close();
          }
        }
        catch (Exception e) {
          throw new ArchiveException( "Error accessing JarFile entry [" + zipEntry.getName() + "]", e );
        }
      }
      else {
        final String name = extractName( zipEntry );
        final String relativeName = extractRelativeName( zipEntry );
        final InputStreamAccess inputStreamAccess;
        try {
          inputStreamAccess = buildByteBasedInputStreamAccess( name, jarFile.getInputStream( zipEntry ) );
        }
        catch (IOException e) {
          throw new ArchiveException(
              String.format(
                  "Unable to access stream from jar file [%s] for entry [%s]",
                  jarFile.getName(),
                  zipEntry.getName()
              )
View Full Code Here

Examples of org.hibernate.jpa.boot.archive.spi.ArchiveException

    final DataInputStream dataInputStream = new DataInputStream( inputStream );
    try {
      return new ClassFile( dataInputStream );
    }
    catch (IOException e) {
      throw new ArchiveException( "Could not build ClassFile" );
    }
    finally {
      try {
        dataInputStream.close();
      }
View Full Code Here

Examples of org.hibernate.jpa.boot.archive.spi.ArchiveException

        final InputStreamAccess inputStreamAccess;
        try {
          inputStreamAccess = buildByteBasedInputStreamAccess( name, jarFile.getInputStream( zipEntry ) );
        }
        catch (IOException e) {
          throw new ArchiveException(
              String.format(
                  "Unable to access stream from jar file [%s] for entry [%s]",
                  jarFile.getName(),
                  zipEntry.getName()
              )
          );
        }

        final ArchiveEntry entry = new ArchiveEntry() {
          @Override
          public String getName() {
            return name;
          }

          @Override
          public String getNameWithinArchive() {
            return relativeName;
          }

          @Override
          public InputStreamAccess getStreamAccess() {
            return inputStreamAccess;
          }
        };
        context.obtainArchiveEntryHandler( entry ).handleEntry( entry, context );
      }
    }
    catch (IOException e) {
      throw new ArchiveException( "Error accessing jar file [" + rootFile.getAbsolutePath() + "]", e );
    }
  }
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.