Skip to content

Commit deffe7a

Browse files
committed
Add Windows directive model
1 parent b0514b2 commit deffe7a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/windows/WindowsDirective.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package windows;
2+
3+
/** Explicit policy controlling whether and how a Windows operation may run. */
4+
public record WindowsDirective(
5+
String name,
6+
boolean allowsExecution,
7+
boolean allowNetwork,
8+
boolean allowWrite,
9+
long timeoutMillis) {
10+
public WindowsDirective {
11+
if (name == null || name.isBlank()) throw new IllegalArgumentException("name is required");
12+
if (timeoutMillis < 0) throw new IllegalArgumentException("timeoutMillis must be non-negative");
13+
}
14+
15+
public static WindowsDirective standard(String name) {
16+
return new WindowsDirective(name, true, false, false, 30_000);
17+
}
18+
}

0 commit comments

Comments
 (0)