src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java
branchJDK-8200758-branch
changeset 57438 4a31db8d42bd
parent 57407 2c14fbeff1dc
child 57446 5a5b85f00a63
equal deleted inserted replaced
57421:0410ee319681 57438:4a31db8d42bd
   111         this.binDir = null;
   111         this.binDir = null;
   112         this.mdir = null;
   112         this.mdir = null;
   113         this.params = new HashMap<>();
   113         this.params = new HashMap<>();
   114     }
   114     }
   115 
   115 
   116     private Path destFile(String dir, String filename) {
       
   117         return runtimeDir.resolve(dir).resolve(filename);
       
   118     }
       
   119 
       
   120     private void writeEntry(InputStream in, Path dstFile) throws IOException {
   116     private void writeEntry(InputStream in, Path dstFile) throws IOException {
   121         Files.createDirectories(dstFile.getParent());
   117         Files.createDirectories(dstFile.getParent());
   122         Files.copy(in, dstFile);
   118         Files.copy(in, dstFile);
   123     }
       
   124 
       
   125     private void writeSymEntry(Path dstFile, Path target) throws IOException {
       
   126         Files.createDirectories(dstFile.getParent());
       
   127         Files.createLink(dstFile, target);
       
   128     }
       
   129 
       
   130     /**
       
   131      * chmod ugo+x file
       
   132      */
       
   133     private void setExecutable(Path file) {
       
   134         try {
       
   135             Set<PosixFilePermission> perms =
       
   136                     Files.getPosixFilePermissions(file);
       
   137             perms.add(PosixFilePermission.OWNER_EXECUTE);
       
   138             perms.add(PosixFilePermission.GROUP_EXECUTE);
       
   139             perms.add(PosixFilePermission.OTHERS_EXECUTE);
       
   140             Files.setPosixFilePermissions(file, perms);
       
   141         } catch (IOException ioe) {
       
   142             throw new UncheckedIOException(ioe);
       
   143         }
       
   144     }
   119     }
   145 
   120 
   146     // it is static for the sake of sharing with "installer" bundlers
   121     // it is static for the sake of sharing with "installer" bundlers
   147     // that may skip calls to validate/bundle in this class!
   122     // that may skip calls to validate/bundle in this class!
   148     public static File getRootDir(File outDir,
   123     public static File getRootDir(File outDir,
   153     public static String getLauncherRelativePath(
   128     public static String getLauncherRelativePath(
   154             Map<String, ? super Object> params) {
   129             Map<String, ? super Object> params) {
   155         return "bin" + File.separator + APP_NAME.fetchFrom(params);
   130         return "bin" + File.separator + APP_NAME.fetchFrom(params);
   156     }
   131     }
   157 
   132 
   158     public static String getLauncherName(Map<String, ? super Object> params) {
   133     private static String getLauncherName(Map<String, ? super Object> params) {
   159         return APP_NAME.fetchFrom(params);
   134         return APP_NAME.fetchFrom(params);
   160     }
   135     }
   161 
   136 
   162     public static String getLauncherCfgName(
   137     public static String getLauncherCfgName(
   163             Map<String, ? super Object> params) {
   138             Map<String, ? super Object> params) {