Fix temp dirs creation (#2209)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -119,7 +119,12 @@ public abstract class AbstractArtifactRepository implements ArtifactRepository {
|
||||
}
|
||||
// try, if not supported - ok
|
||||
if (!file.setExecutable(false)) {
|
||||
log.debug("Can't set executable permissions for temp file {}", file);
|
||||
log.debug("Can't remove executable permissions for temp file {}", file);
|
||||
}
|
||||
if (directory) {
|
||||
if (!file.setExecutable(true, true)) {
|
||||
log.debug("Can't set executable permissions for temp directory {} for the owner", file);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
} catch (final IOException e) {
|
||||
|
||||
@@ -487,8 +487,7 @@ public abstract class AbstractIntegrationTest {
|
||||
try {
|
||||
final File file = Files.createTempFile(String.valueOf(System.currentTimeMillis()), "hawkbit_test").toFile();
|
||||
file.deleteOnExit();
|
||||
if (!file.setReadable(true, true) ||
|
||||
!file.setWritable(true, true)) {
|
||||
if (!file.setReadable(true, true) || !file.setWritable(true, true)) {
|
||||
if (file.delete()) { // try to delete immediately, if failed - on exit
|
||||
throw new IOException("Can't set proper permissions!");
|
||||
} else {
|
||||
@@ -497,7 +496,7 @@ public abstract class AbstractIntegrationTest {
|
||||
}
|
||||
// try, if not supported - ok
|
||||
if (!file.setExecutable(false)) {
|
||||
log.debug("Can't set executable permissions for temp file {}", file);
|
||||
log.debug("Can't remove executable permissions for temp file {}", file);
|
||||
}
|
||||
return file;
|
||||
} catch (final IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user