• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wurstscript / WurstScript / 269

29 Sep 2025 11:58AM UTC coverage: 64.66% (+2.4%) from 62.222%
269

Pull #1096

circleci

Frotty
add RealRealMixed rewrites and tests
Pull Request #1096: Perf improvements

18205 of 28155 relevant lines covered (64.66%)

0.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.22
de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/mpq/Jmpq3BasedEditor.java
1
package de.peeeq.wurstio.mpq;
2

3
import com.google.common.base.Preconditions;
4
import systems.crigges.jmpq3.JMpqEditor;
5
import systems.crigges.jmpq3.JMpqException;
6
import systems.crigges.jmpq3.MPQOpenOption;
7

8
import java.io.File;
9
import java.io.FileNotFoundException;
10
import java.io.IOException;
11

12
class Jmpq3BasedEditor implements MpqEditor {
13

14
    private final JMpqEditor editor;
15

16
    private JMpqEditor getEditor() {
17
        return editor;
1✔
18
    }
19

20
    public Jmpq3BasedEditor(File mpqArchive, boolean readonly) throws Exception {
1✔
21
        Preconditions.checkNotNull(mpqArchive);
1✔
22
        if (!mpqArchive.exists()) {
1✔
23
            throw new FileNotFoundException("not found: " + mpqArchive);
×
24
        }
25
        this.editor = new JMpqEditor(mpqArchive, readonly ? MPQOpenOption.READ_ONLY : MPQOpenOption.FORCE_V0);
1✔
26
    }
1✔
27

28
    @Override
29
    public void insertFile(String filenameInMpq, byte[] contents) {
30
        getEditor().insertByteArray(filenameInMpq, contents);
×
31
    }
×
32

33
    @Override
34
    public void insertFile(String filenameInMpq, File contents) throws Exception {
35
        getEditor().insertFile(filenameInMpq, contents, false);
1✔
36
    }
1✔
37

38
    @Override
39
    public boolean canWrite() {
40
        return editor.isCanWrite();
×
41
    }
42

43
    @Override
44
    public byte[] extractFile(String fileToExtract) throws Exception {
45
        return getEditor().extractFileAsBytes(fileToExtract);
1✔
46
    }
47

48
    @Override
49
    public void deleteFile(String filenameInMpq) {
50
        getEditor().deleteFile(filenameInMpq);
1✔
51
    }
1✔
52

53
    @Override
54
    public void close() throws IOException {
55
        try {
56
            editor.close();
1✔
57
        } catch (JMpqException e) {
×
58
            throw new IOException(e);
×
59
        }
1✔
60
    }
1✔
61

62
    @Override
63
    public boolean hasFile(String fileName) {
64
        return getEditor().hasFile(fileName);
1✔
65
    }
66

67
    @Override
68
    public void setKeepHeaderOffset(boolean flag) {
69
        editor.setKeepHeaderOffset(flag);
×
70
    }
×
71

72
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc