Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 81 for zipEntry (0.22 sec)

  1. subprojects/core/src/testFixtures/groovy/org/gradle/util/JarUtils.groovy

    import java.util.jar.Manifest
    import java.util.zip.ZipEntry
    
    class JarUtils {
        static def jarWithContents(Map<String, String> contents) {
            def out = new ByteArrayOutputStream()
            def jarOut = new JarOutputStream(out)
            try {
                contents.each { file, fileContents ->
                    def zipEntry = new ZipEntry(file)
                    zipEntry.setTime(0)
                    jarOut.putNextEntry(zipEntry)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Aug 07 19:17:11 UTC 2023
    - 6.4K bytes
    - Viewed (0)
  2. platforms/jvm/normalization-java/src/test/groovy/org/gradle/api/internal/changedetection/state/PropertiesFileAwareClasspathResourceHasherTest.groovy

            return zipEntry(path, bos.toByteArray())
        }
    
        static ZipEntryContext zipEntry(String path, byte[] bytes, boolean unsafe = false, boolean directory = false) {
            def zipEntry = new ZipEntry() {
                @Override
                boolean isDirectory() {
                    return directory
                }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Dec 11 13:37:56 UTC 2023
    - 15.6K bytes
    - Viewed (0)
  3. platforms/jvm/normalization-java/src/main/java/org/gradle/api/internal/changedetection/state/AbiExtractingClasspathResourceHasher.java

            ZipEntry zipEntry = zipEntryContext.getEntry();
    
            if (isNotClassFile(zipEntry.getName())) {
                return null;
            }
    
            // A failure to read the zip entry content is a failure to read from the zip stream and should
            // be handled as a failure at the file level rather than at the entry level
            byte[] content = zipEntry.getContent();
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Sep 28 15:09:49 UTC 2023
    - 6.4K bytes
    - Viewed (0)
  4. platforms/core-runtime/files/src/test/groovy/org/gradle/api/internal/file/archive/impl/StreamZipInputTest.groovy

            def zipInput = new StreamZipInput(makeZip("foo.zip").newInputStream())
    
            when:
            def zipEntry = zipInput.iterator().next()
            def content = zipEntry.withInputStream { readAllBytes(it) }
    
            then:
            content == ZIP_ENTRY_CONTENT.bytes
            noExceptionThrown()
    
            when:
            zipEntry.withInputStream { readAllBytes(it) }
    
            then:
            thrown(IllegalStateException)
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:55:52 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  5. platforms/jvm/normalization-java/src/test/groovy/org/gradle/api/internal/changedetection/state/AbiExtractingClasspathResourceHasherTest.groovy

            def zipEntryContext = Mock(ZipEntryContext)
            def zipEntry = Mock(ZipEntry)
            def classContent = bytesOf(String.class)
    
            when:
            def hash = resourceHasher.hash(zipEntryContext)
    
            then:
            1 * zipEntryContext.getEntry() >> zipEntry
            2 * zipEntry.getName() >> 'String.class'
            1 * zipEntry.getContent() >> classContent
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Sep 28 15:09:49 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  6. platforms/core-runtime/files/src/test/groovy/org/gradle/api/internal/file/archive/impl/FileZipInputTest.groovy

            def file = makeZip("foo.zip")
            def zipInput = FileZipInput.create(file)
    
            when:
            def zipEntry = zipInput.iterator().next()
            def content = zipEntry.withInputStream { readAllBytes(it) }
    
            then:
            content == ZIP_ENTRY_CONTENT.bytes
    
            when:
            content = zipEntry.withInputStream { readAllBytes(it) }
    
            then:
            noExceptionThrown()
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:55:52 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  7. platforms/core-runtime/files/src/test/groovy/org/gradle/api/internal/file/archive/impl/ZipFileFixture.groovy

            def file = temporaryFolder.file("foo.txt")
            file.text = ZIP_ENTRY_CONTENT
            def zipStream = new ZipOutputStream(zipFile.newOutputStream())
            def zipEntry = new ZipEntry(file.name)
            zipEntry.setSize(file.size())
            zipStream.putNextEntry(zipEntry)
            zipStream.write(file.bytes)
            zipStream.close()
            return zipFile
        }
    
        abstract TestNameTestDirectoryProvider getTemporaryFolder()
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:55:52 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  8. build-logic/binary-compatibility/src/main/groovy/gradlebuild/binarycompatibility/transforms/ExplodeZipAndFindJars.groovy

            File dependencies = outputs.dir("gradle-dependencies")
            try (ZipInputStream zin = new ZipInputStream(artifact.get().asFile.newInputStream())) {
                ZipEntry zipEntry
                while (zipEntry = zin.nextEntry) {
                    String shortName = zipEntry.name
                    if (shortName.contains('/')) {
                        shortName = shortName.substring(shortName.lastIndexOf('/') + 1)
                    }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Jul 08 13:44:59 UTC 2021
    - 2.4K bytes
    - Viewed (0)
  9. build-logic/performance-testing/src/main/groovy/gradlebuild/performance/generator/MavenJarCreator.groovy

            // Add archive entry
            ZipEntry entry = normalizedZipEntry(name)
            out.putNextEntry(entry)
    
            // Write file to archive
            def contentBytes = content.getBytes("utf-8")
            out.write(contentBytes, 0, contentBytes.length)
        }
    
        private void addGeneratedUncompressedZipEntry(ZipOutputStream out, String name, int sizeInBytes) {
            ZipEntry entry = normalizedZipEntry(name)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed May 05 09:51:22 UTC 2021
    - 2.9K bytes
    - Viewed (0)
  10. platforms/core-runtime/files/src/main/java/org/gradle/api/internal/file/archive/impl/FileZipInput.java

        private final Enumeration<? extends java.util.zip.ZipEntry> entries;
    
        private FileZipInput(File file) {
            try {
                this.file = new ZipFile(file);
            } catch (IOException e) {
                throw new FileException(e);
            }
            this.entries = this.file.entries();
        }
    
        @Override
        public Iterator<ZipEntry> iterator() {
            return new AbstractIterator<ZipEntry>() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue May 28 12:11:00 UTC 2024
    - 3.9K bytes
    - Viewed (0)
Back to top