Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting Content-type on data created from GCS connector FS calls #37

Open
DeaconDesperado opened this issue Sep 5, 2016 · 0 comments
Open

Comments

@DeaconDesperado
Copy link

DeaconDesperado commented Sep 5, 2016

Hello!

Currently data we create via the GCS connector using regular FS calls always defaults to application/octet-stream for it's content-type in the metadata.

Is there a way to configure this when writing per file?

Example using Jackson to write json:

private static final ObjectMapper MAPPER = new ObjectMapper();

FileSystem fs = FileSystem.get(getConfiguration());
Path path = new Path("gs://some-bucket/somepath.json");
try (FSDataOutputStream outputStream = fs.create(path)) {
   MAPPER.writeWithDefaultPrettyPrinter().writeValue(outputStream, someJsonObject);
}

Results in:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant