Examples of ArchiveException


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

  public static byte[] getBytesFromInputStreamSafely(InputStream inputStream) {
    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

          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

    try {
      return new BufferedInputStream( new FileInputStream( file ) );
    }
    catch (FileNotFoundException e) {
      // should never ever ever happen, but...
      throw new ArchiveException(
          "File believed to exist based on File.exists threw error when passed to FileInputStream ctor",
          e
      );
    }
  }
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

          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
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.