File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
jbrowse/src/org/labkey/jbrowse Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 5050
5151import java .io .File ;
5252import java .io .IOException ;
53+ import java .nio .file .FileSystems ;
54+ import java .nio .file .Files ;
55+ import java .nio .file .attribute .PosixFilePermission ;
5356import java .util .Arrays ;
5457import java .util .List ;
5558import java .util .Map ;
59+ import java .util .Set ;
5660
5761public class JBrowseManager
5862{
@@ -218,6 +222,23 @@ else if (SystemUtils.IS_OS_MAC_OSX)
218222 throw new PipelineJobException ("Unknown OS: " + SystemUtils .OS_NAME );
219223 }
220224
225+ try
226+ {
227+ if (FileSystems .getFileSystem (exe .toURI ()).supportedFileAttributeViews ().contains ("posix" ))
228+ {
229+ Set <PosixFilePermission > perms = Files .getPosixFilePermissions (exe .toPath ());
230+ if (!perms .contains (PosixFilePermission .OWNER_EXECUTE ))
231+ {
232+ perms .add (PosixFilePermission .OWNER_EXECUTE );
233+ Files .setPosixFilePermissions (exe .toPath (), perms );
234+ }
235+ }
236+ }
237+ catch (IOException e )
238+ {
239+ throw new PipelineJobException (e );
240+ }
241+
221242 if (!exe .exists ())
222243 {
223244 throw new PipelineJobException ("Unable to find file: " + exe .getPath ());
You can’t perform that action at this time.
0 commit comments