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

jscancella / bagging / 4d62d4f2-8169-4233-b46e-bb15ca33adef

pending completion
4d62d4f2-8169-4233-b46e-bb15ca33adef

Pull #74

circleci

John Scancella
feat: actually check new profile features
Pull Request #74: feat: update bagitprofile parsing for 1.4.0 version

32 of 32 new or added lines in 2 files covered. (100.0%)

744 of 799 relevant lines covered (93.12%)

0.93 hits per line

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

0.0
/src/main/java/com/github/jscancella/conformance/internal/DataDirIsEmptyChecker.java
1
package com.github.jscancella.conformance.internal;
2

3
import java.io.IOException;
4
import java.nio.file.FileVisitResult;
5
import java.nio.file.Files;
6
import java.nio.file.Path;
7
import java.nio.file.SimpleFileVisitor;
8
import java.nio.file.attribute.BasicFileAttributes;
9
import java.util.Collections;
10
import java.util.HashSet;
11
import java.util.Set;
12

13
/**
14
 * Checks for zero byte files and non zero byte files and records them for use in data directory must be empty bagit profile
15
 */
16
public class DataDirIsEmptyChecker extends SimpleFileVisitor<Path> {
17
  private final Set<Path> nonZeroByteFiles;
18
  private final Set<Path> zeroByteFiles;
19
  
20
  /**
21
   * Checks for zero byte files and non zero byte files and records them for use in data directory must be empty bagit profile
22
   */
23
  public DataDirIsEmptyChecker() {
24
    super();
×
25
    this.nonZeroByteFiles = new HashSet<>();
×
26
    this.zeroByteFiles = new HashSet<>();
×
27
  }
×
28

29
  @Override
30
  public FileVisitResult visitFile(final Path path, final BasicFileAttributes attrs) throws IOException{
31
    if(Files.size(path)>0) {
×
32
      this.nonZeroByteFiles.add(path);
×
33
    }
34
    else {
35
      this.zeroByteFiles.add(path);
×
36
    }
37
    
38
    return FileVisitResult.CONTINUE;
×
39
  }
40
  
41
  /**
42
   * @return the nonZeroByteFiles
43
   */
44
  public Set<Path> getNonZeroByteFiles() {
45
    return Collections.unmodifiableSet(nonZeroByteFiles);
×
46
  }
47

48
  /**
49
   * @return the zeroByteFiles
50
   */
51
  public Set<Path> getZeroByteFiles() {
52
    return Collections.unmodifiableSet(zeroByteFiles);
×
53
  }
54
}
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