Static resource bundling doesn't work in CE

Issue #167 resolved
Nathen Drees created an issue

I'm on IDEA 15 CE and I don't see the menu option to convert a static resource bundle. Not sure if this related to CE vs UE or if I'm just missing something.

Illuminated Cloud version 1.6.6.2-idea14

meta.png

neby.png

Comments (8)

  1. Scott Wells repo owner

    Nathen, it's because of the content type of the resource in the meta.xml file. It needs to resolve to a zip file via the MIME type for the option to be enabled, e.g., application/zip. I can loosen that up if it's a real issue, but I didn't want to enable the option on arbitrary static resources where extraction would be guaranteed to fail.

  2. Nathen Drees reporter

    Scott -

    That's the mime type Salesforce sets when you upload a zip file through the UI. Maybe IC could do some sort of trial extraction on these resources to see if they're zip files, and if it succeeds just change the MIME Type to application/zip and re-upload the meta file? Some sort of one-time fix.

    If not, I would just add it to the docs somewhere that the MIME type needs to match a zip type and we'll just fix them as we find them.

  3. Scott Wells repo owner

    I'd prefer not to change a content type that's been purposefully set for some reason or another. I'll look at options to give the user the menu item anytime it even potentially should be available without setting the user up for an ugly error if it's not a good match.

  4. Scott Wells repo owner

    That link helps, Nathen. I think rather than enable the option on static files with arbitrary content types, I'll enable them when the associated MIME type is specifically for an archive (I can test this reliably now) or the expressed content type is one of the known ones provided when uploading a static resource, in particular application/zip, application/x-zip-compressed, or application/octet-stream. I can expand that over time based on end user experience, but I'd prefer to start conservative to minimize errors.

  5. Scott Wells repo owner

    This is implemented and will be in the next build. I've verified that if the underlying file isn't a valid zip archive, a reasonable error is presented to the user ("error in opening zip file") and no changes occur in the file system.

  6. Scott Wells repo owner

    In 1.6.6.3 (for release tonight or tomorrow morning), you can now create static resource bundles from resources with content types: application/zip, application/x-zip-compressed, application/octet-stream.

  7. Log in to comment