@Test void testGetManifestExceedsSizeLimit() throws Exception { assertThrows(ContentException.class, () -> ArchiveHandler.getManifest(ArchiveHandlerTest.class.getResourceAsStream(SAMPLE_MTAR), 512L)); }
public static Manifest getManifest(InputStream archiveStream, long maxManifestSize) throws SLException { try (InputStream manifestStream = getInputStream(archiveStream, JarFile.MANIFEST_NAME, maxManifestSize)) { return new Manifest(manifestStream); } catch (IOException e) { throw new SLException(e, Messages.ERROR_RETRIEVING_MTA_ARCHIVE_MANIFEST); } }
ArchiveHandler { public static Manifest getManifest(InputStream archiveStream, long maxManifestSize) throws SLException { try (InputStream manifestStream = getInputStream(archiveStream, JarFile.MANIFEST_NAME, maxManifestSize)) { return new Manifest(manifestStream); } catch (IOException e) { throw new SLException(e, Messages.ERROR_RETRIEVING_MTA_ARCHIVE_MANIFEST); } } }
ArchiveHandler { public static Manifest getManifest(InputStream archiveStream, long maxManifestSize) throws SLException { try (InputStream manifestStream = getInputStream(archiveStream, JarFile.MANIFEST_NAME, maxManifestSize)) { return new Manifest(manifestStream); } catch (IOException e) { throw new SLException(e, Messages.ERROR_RETRIEVING_MTA_ARCHIVE_MANIFEST); } }  }
ArchiveHandler { public static Manifest getManifest(InputStream archiveStream, long maxManifestSize) throws SLException { try (InputStream manifestStream = getInputStream(archiveStream, JarFile.MANIFEST_NAME, maxManifestSize)) { return new Manifest(manifestStream); } catch (IOException e) { throw new SLException(e, Messages.ERROR_RETRIEVING_MTA_ARCHIVE_MANIFEST); } }  static Manifest getManifest(InputStream archiveStream, long maxManifestSize); static String getDescriptor(InputStream archiveStream, long maxMtaDescriptorSize); static byte[] getFileContent(InputStream archiveStream, String fileName, long maxMtaFileSize); static InputStream getInputStream(InputStream is, String entryName, long maxEntrySize); }
ArchiveHandler { public static Manifest getManifest(InputStream archiveStream, long maxManifestSize) throws SLException { try (InputStream manifestStream = getInputStream(archiveStream, JarFile.MANIFEST_NAME, maxManifestSize)) { return new Manifest(manifestStream); } catch (IOException e) { throw new SLException(e, Messages.ERROR_RETRIEVING_MTA_ARCHIVE_MANIFEST); } }  static Manifest getManifest(InputStream archiveStream, long maxManifestSize); static String getDescriptor(InputStream archiveStream, long maxMtaDescriptorSize); static byte[] getFileContent(InputStream archiveStream, String fileName, long maxMtaFileSize); static InputStream getInputStream(InputStream is, String entryName, long maxEntrySize); static final String MTA_DEPLOYMENT_DESCRIPTOR_NAME; }