Skip to content

Commit

Permalink
fix: compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Aug 5, 2024
1 parent 51758ec commit e70bc71
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/git/Push.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public Output run(RunContext runContext) throws Exception {
.findAllFilesMatching(this.namespaceFiles.getInclude(), this.namespaceFiles.getExclude())
.forEach(Rethrow.throwConsumer(namespaceFile -> {
InputStream content = runContext.storage().getFile(namespaceFile.uri());
runContext.workingDir().putFile(namespaceFile.path(), content);
runContext.workingDir().putFile(Path.of(namespaceFile.path()), content);
}));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/git/PushNamespaceFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ protected Map<Path, Supplier<InputStream>> instanceResourcesContentByPath(RunCon
.stream()
.collect(Collectors.toMap(
nsFile -> baseDirectory.resolve(nsFile.path(false)),
throwFunction(nsFile -> throwSupplier(() -> storage.getFileContent(nsFile.path())))
throwFunction(nsFile -> throwSupplier(() -> storage.getFileContent(Path.of(nsFile.path()))))
));
}

Expand Down
11 changes: 8 additions & 3 deletions src/main/java/io/kestra/plugin/git/SyncNamespaceFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -108,9 +109,13 @@ protected URI simulateResourceWrite(RunContext runContext, String renderedNamesp
protected URI writeResource(RunContext runContext, String renderedNamespace, URI uri, InputStream inputStream) throws IOException {
Namespace namespace = runContext.storage().namespace(renderedNamespace);

return inputStream == null ?
URI.create(namespace.createDirectory(Path.of(uri.getPath())) + "/") :
namespace.putFile(Path.of(uri.getPath()), inputStream).uri();
try {
return inputStream == null ?
URI.create(namespace.createDirectory(Path.of(uri.getPath())) + "/") :
namespace.putFile(Path.of(uri.getPath()), inputStream).uri();
} catch (URISyntaxException e) {
throw new IOException(e);
}
}

@Override
Expand Down

0 comments on commit e70bc71

Please sign in to comment.