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

kit-data-manager / ro-crate-java / #348

15 Apr 2025 08:24AM UTC coverage: 86.955%. First build
#348

Pull #233

github

web-flow
Merge pull request #244 from kit-data-manager/renovate/commons-io-commons-io-2.x

chore(deps): update dependency commons-io:commons-io to v2.19.0
Pull Request #233: Version 2.1.0

521 of 659 new or added lines in 18 files covered. (79.06%)

1873 of 2154 relevant lines covered (86.95%)

0.87 hits per line

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

66.67
/src/main/java/edu/kit/datamanager/ro_crate/writer/StreamWriterStrategy.java
1
package edu.kit.datamanager.ro_crate.writer;
2

3
import edu.kit.datamanager.ro_crate.Crate;
4
import java.io.File;
5
import java.io.FileNotFoundException;
6
import java.io.FileOutputStream;
7
import java.io.OutputStream;
8
import org.slf4j.LoggerFactory;
9

10
/**
11
 * Strategy for writing of crates to streams.
12
 *
13
 * @author jejkal
14
 */
15
public interface StreamWriterStrategy extends WriterStrategy {
16

17
    static org.slf4j.Logger logger = LoggerFactory.getLogger(StreamWriterStrategy.class);
1✔
18

19
    /**
20
     * Default override of save interface from WriterStrategy. The override
21
     * assumes, that destination is a file, which is used as output stream. If
22
     * this assumption is not true, this call will fail.
23
     *
24
     * @param crate The crate to write.
25
     * @param destination The destination, which is supposed to be a file.
26
     */
27
    default void save(Crate crate, String destination) {
28
        try {
29
            save(crate, new FileOutputStream(new File(destination)));
1✔
NEW
30
        } catch (FileNotFoundException ex) {
×
NEW
31
            logger.error("Failed save crate to destination " + destination, ex);
×
32
        }
1✔
33
    }
1✔
34

35
    void save(Crate crate, OutputStream destination);
36
}
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

© 2025 Coveralls, Inc