You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Iván López <no...@github.com> on 2015/06/21 13:51:01 UTC

[jclouds] JCLOUDS-941: Add the Content-Type header for filesystem blobstore (#780)

Auto-detect the content-type if it's null.

I think the feature is working in my first commit (135b609). 

In the second one I tried to add the property @andrewgaul suggested in the JIRA but I'm not really sure if this is the right way to do it. Besides, if I run the tests only for the class they all pass but when I execute the `install` target some tests fail because this Guice error that I don't know how to fix it:

```
com.google.inject.CreationException: Guice creation errors:

1) No implementation for java.lang.Boolean annotated with @com.google.inject.name.Named(value=jclouds.filesystem.auto-detect-content-type) was bound.
  while locating java.lang.Boolean annotated with @com.google.inject.name.Named(value=jclouds.filesystem.auto-detect-content-type)
    for parameter 2 at org.jclouds.filesystem.strategy.internal.FilesystemStorageStrategyImpl.<init>(FilesystemStorageStrategyImpl.java:121)
  at org.jclouds.filesystem.config.FilesystemBlobStoreContextModule.configure(FilesystemBlobStoreContextModule.java:43)
```

@andrewgaul I've been looking how to inject a property from a property file but I don't know how to do it. Could you please point me to an example or give me a hint how to do it?

Regards, Iván.
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/780

-- Commit Summary --

  * Auto-detect the Content-Type if it is null
  * WIP: Configure auto detect content-type behaviour

-- File Changes --

    M apis/filesystem/src/main/java/org/jclouds/filesystem/reference/FilesystemConstants.java (3)
    M apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java (7)
    M apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemBlobStoreTest.java (1)
    M apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java (36)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/780.patch
https://github.com/jclouds/jclouds/pull/780.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/780

Re: [jclouds] JCLOUDS-941: Add the Content-Type header for filesystem blobstore (#780)

Posted by Iván López <no...@github.com>.
Thank you @nacx! I fixed it and now it is working!

I've built my own version of s3proxy with my compile jclouds and it detects correctly the content-type and plays the video in the browser.

I've done two commits, do you prefer that I ammed the, in only one?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/780#issuecomment-113911591

Re: [jclouds] JCLOUDS-941: Add the Content-Type header for filesystem blobstore (#780)

Posted by Ignasi Barrera <no...@github.com>.
To complete the answer, users will be able to override the value when creating the context, and you'll be able to provide a custom value when running the tests, if needed,  passing the value to the command line as a system property "-D....".

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/780#issuecomment-113894201

Re: [jclouds] JCLOUDS-941: Add the Content-Type header for filesystem blobstore (#780)

Posted by Ignasi Barrera <no...@github.com>.
If the property is not annotated as `@Nullable` Guice will fail to create the injector when missing. 

You should assign a default value in the FileSystemApiMetadata class by overriding the `defaultProperties` method 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/780#issuecomment-113893872

Re: [jclouds] JCLOUDS-941: Auto-detect filesystem Content-Type (#780)

Posted by Iván López <no...@github.com>.
Great! Thank you very much! :smile: 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/780#issuecomment-114015001

Re: [jclouds] JCLOUDS-941: Auto-detect filesystem Content-Type (#780)

Posted by Andrew Gaul <no...@github.com>.
Squashed commits, reworded commit message, changed `Boolean` to `boolean`, and pushed to master as 37a014ae00788fd8402f444dbfb93c364c9f1a4d.  Thank you for your contribution @lmivan!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/780#issuecomment-114014710