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

devonfw / IDEasy / 9907372175

12 Jul 2024 11:49AM UTC coverage: 61.142% (-0.02%) from 61.162%
9907372175

push

github

hohwille
fixed tests

1997 of 3595 branches covered (55.55%)

Branch coverage included in aggregate %.

5296 of 8333 relevant lines covered (63.55%)

2.8 hits per line

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

83.33
cli/src/main/java/com/devonfw/tools/ide/merge/AbstractWorkspaceMerger.java
1
package com.devonfw.tools.ide.merge;
2

3
import java.io.IOException;
4
import java.nio.file.Files;
5
import java.nio.file.Path;
6

7
import com.devonfw.tools.ide.context.IdeContext;
8

9
/**
10
 * {@link WorkspaceMerger} responsible for a single type of {@link Path}.
11
 *
12
 * @since 3.0.0
13
 */
14
public abstract class AbstractWorkspaceMerger implements WorkspaceMerger {
15

16
  /** The {@link IdeContext} for logging. */
17
  protected final IdeContext context;
18

19
  /**
20
   * The constructor.
21
   *
22
   * @param context the {@link IdeContext}.
23
   */
24
  public AbstractWorkspaceMerger(IdeContext context) {
25

26
    super();
2✔
27
    this.context = context;
3✔
28
  }
1✔
29

30
  /**
31
   * @param file the {@link Path} for which the {@link Path#getParent() parent directory} needs to exist and will be created if absent by this method.
32
   */
33
  protected static void ensureParentDirectoryExists(Path file) {
34

35
    Path parentDir = file.getParent();
3✔
36
    if (!Files.exists(parentDir)) {
5✔
37
      try {
38
        Files.createDirectories(parentDir);
5✔
39
      } catch (IOException e) {
×
40
        throw new IllegalStateException("Could not create required directories for file: " + file, e);
×
41
      }
1✔
42
    }
43
  }
1✔
44

45
}
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