Skip to content

Commit

Permalink
fix: Added Google Storage write scope to WriteOptions
Browse files Browse the repository at this point in the history
Solves #163
  • Loading branch information
jruaux committed Nov 27, 2024
1 parent 81ec067 commit 4179ae4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

import org.springframework.batch.item.Chunk;
import org.springframework.batch.item.json.JsonObjectMarshaller;
import org.springframework.batch.item.support.AbstractFileItemWriter;
import org.springframework.core.io.Resource;
import org.springframework.core.io.WritableResource;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;

import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.redis.riot.resource.AbstractFileItemWriter;

/**
* Item writer that writes data in XML format to an output file. The location of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
import org.springframework.batch.item.file.FlatFileFooterCallback;
import org.springframework.batch.item.file.FlatFileHeaderCallback;
import org.springframework.batch.item.json.JsonObjectMarshaller;
import org.springframework.batch.item.support.AbstractFileItemWriter;
import org.springframework.core.io.Resource;
import org.springframework.core.io.WritableResource;
import org.springframework.util.Assert;

import com.redis.riot.resource.AbstractFileItemWriter;

/**
* Builder for {@link XmlResourceItemWriter}.
*
Expand Down
2 changes: 2 additions & 0 deletions plugins/riot/src/main/java/com/redis/riot/FileWriterArgs.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.redis.riot;

import com.google.cloud.spring.core.GcpScope;
import com.redis.riot.file.WriteOptions;

import lombok.ToString;
Expand Down Expand Up @@ -38,6 +39,7 @@ public class FileWriterArgs extends FileArgs {
public WriteOptions fileWriterOptions() {
WriteOptions options = new WriteOptions();
apply(options);
options.getGoogleStorageOptions().setScope(GcpScope.STORAGE_READ_WRITE);
options.setAppend(append);
options.setElementName(elementName);
options.setForceSync(forceSync);
Expand Down

0 comments on commit 4179ae4

Please sign in to comment.