equal
deleted
inserted
replaced
40 import java.util.regex.Matcher; |
40 import java.util.regex.Matcher; |
41 import java.util.regex.Pattern; |
41 import java.util.regex.Pattern; |
42 import java.util.stream.Collectors; |
42 import java.util.stream.Collectors; |
43 import java.util.stream.Stream; |
43 import java.util.stream.Stream; |
44 import static jdk.jpackage.internal.LinuxAppBundler.LINUX_INSTALL_DIR; |
44 import static jdk.jpackage.internal.LinuxAppBundler.LINUX_INSTALL_DIR; |
|
45 import static jdk.jpackage.internal.OverridableResource.createResource; |
45 |
46 |
46 import static jdk.jpackage.internal.StandardBundlerParam.*; |
47 import static jdk.jpackage.internal.StandardBundlerParam.*; |
47 |
48 |
48 |
49 |
49 public class LinuxDebBundler extends LinuxPackageBundler { |
50 public class LinuxDebBundler extends LinuxPackageBundler { |
330 return this; |
331 return this; |
331 } |
332 } |
332 |
333 |
333 void create(Map<String, String> data, Map<String, ? super Object> params) |
334 void create(Map<String, String> data, Map<String, ? super Object> params) |
334 throws IOException { |
335 throws IOException { |
335 Files.createDirectories(dstFilePath.getParent()); |
336 createResource("template." + dstFilePath.getFileName().toString(), |
336 try (Writer w = Files.newBufferedWriter(dstFilePath)) { |
337 params) |
337 String content = preprocessTextResource( |
338 .setCategory(I18N.getString(comment)) |
338 dstFilePath.getFileName().toString(), |
339 .setSubstitutionData(data) |
339 I18N.getString(comment), |
340 .saveToFile(dstFilePath); |
340 "template." + dstFilePath.getFileName().toString(), |
|
341 data, |
|
342 VERBOSE.fetchFrom(params), |
|
343 RESOURCE_DIR.fetchFrom(params)); |
|
344 w.write(content); |
|
345 } |
|
346 if (permissions != null) { |
341 if (permissions != null) { |
347 setPermissions(dstFilePath.toFile(), permissions); |
342 setPermissions(dstFilePath.toFile(), permissions); |
348 } |
343 } |
349 } |
344 } |
350 |
345 |