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

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

29 Apr 2025 06:44PM UTC coverage: 89.357%. First build
#392

Pull #233

github

Pfeil
fix: add newline at end of gradle.yml for consistency
Pull Request #233: Version 2.1.0

608 of 700 new or added lines in 28 files covered. (86.86%)

1889 of 2114 relevant lines covered (89.36%)

0.89 hits per line

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

80.0
/src/main/java/edu/kit/datamanager/ro_crate/reader/FolderStrategy.java
1
package edu.kit.datamanager.ro_crate.reader;
2

3
import com.fasterxml.jackson.databind.ObjectMapper;
4
import com.fasterxml.jackson.databind.node.ObjectNode;
5
import edu.kit.datamanager.ro_crate.objectmapper.MyObjectMapper;
6

7
import java.io.File;
8
import java.io.IOException;
9
import java.nio.file.Path;
10

11
/**
12
 * A class for reading a crate from a folder.
13
 *
14
 * @author Nikola Tzotchev on 9.2.2022 г.
15
 * @version 1
16
 */
17
public class FolderStrategy implements GenericReaderStrategy<String> {
1✔
18

19
  @Override
20
  public ObjectNode readMetadataJson(String location) {
21
    Path metadata = new File(location).toPath().resolve("ro-crate-metadata.json");
1✔
22
    ObjectMapper objectMapper = MyObjectMapper.getMapper();
1✔
23
    ObjectNode objectNode = objectMapper.createObjectNode();
1✔
24
    try {
25
      objectNode = objectMapper.readTree(metadata.toFile()).deepCopy();
1✔
NEW
26
    } catch (IOException e) {
×
NEW
27
      e.printStackTrace();
×
28
    }
1✔
29
    return objectNode;
1✔
30
  }
31

32
  @Override
33
  public File readContent(String location) {
34
    return new File(location);
1✔
35
  }
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