Skip to content

Commit

Permalink
deps(upgrade): bump com.github.marschall:memoryfilesystem from 2.1.0 …
Browse files Browse the repository at this point in the history
…to 2.6.1

Bumps [com.github.marschall:memoryfilesystem](https://github.com/marschall/memoryfilesystem) from 2.1.0 to 2.6.1.
- [Release notes](https://github.com/marschall/memoryfilesystem/releases)
- [Commits](marschall/memoryfilesystem@2.1.0...2.6.1)

---
updated-dependencies:
- dependency-name: com.github.marschall:memoryfilesystem
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Steve Todorov <[email protected]>
  • Loading branch information
dependabot[bot] and steve-todorov committed Jul 28, 2023
1 parent 9a59abb commit 1148570
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencies {
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.0")
testImplementation("org.apache.commons:commons-lang3:3.12.0")
testImplementation("com.github.marschall:zipfilesystem-standalone:1.0.1")
testImplementation("com.github.marschall:memoryfilesystem:2.1.0")
testImplementation("com.github.marschall:memoryfilesystem:2.6.1")
testImplementation("org.mockito:mockito-core:3.9.0")
testImplementation("org.mockito:mockito-inline:3.9.0")
testImplementation("org.mockito:mockito-junit-jupiter:3.9.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.nio.file.StandardCopyOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.PosixFileAttributeView;
import java.nio.file.attribute.PosixFileAttributes;
import java.nio.file.attribute.PosixFilePermission;
import java.time.Instant;
Expand Down Expand Up @@ -207,10 +208,22 @@ void addFile(final Path bucket,

Path file = Files.createFile(bucket.resolve(fileName.replaceAll("/", "%2F")), attrs);

// This is needed for marschall/memoryfilesystem >= 2.6.1+
PosixFileAttributeView fileAttributeView = file.getFileSystem().provider().getFileAttributeView(file, PosixFileAttributeView.class);

Set<PosixFilePermission> perms = new HashSet<>();
perms.add(PosixFilePermission.OWNER_WRITE);
perms.add(PosixFilePermission.OWNER_READ);
perms.add(PosixFilePermission.OWNER_EXECUTE);

fileAttributeView.setPermissions(perms);
// /This is needed for marschall/memoryfilesystem >= 2.6.1+

try (OutputStream outputStream = Files.newOutputStream(file))
{
outputStream.write(content);
}

}

void addDirectory(final Path bucket,
Expand Down

0 comments on commit 1148570

Please sign in to comment.