FileImporter API Broken with ZIP files #737

Open
allfro opened this Issue Jan 31, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@allfro

allfro commented Jan 31, 2013

The FileImporter Plugin API does not pass the FileObject corresponding to the file chosen in the chooser. Instead, contents of the zip file are passed to the isMatchingImporter() method which breaks import. To reproduce the issue:

  • Create a simple FileImport plugin that's associated with a zip file format
  • Set a breakpoint inside the isMatchingImporter() method to inspect the contents of the FileObject instance.
  • Open the zip file using the plugin in Gephi in Netbeans debug mode
  • Inspect the name field in the FileObject instance and you'll notice it corresponds to the contents of the zip file. In cases where it doesn't, isMatchingImporter is called twice. Once with the valid name, and the second time with the name of an archived file or folder.
@mbastian

This comment has been minimized.

Show comment Hide comment
@mbastian

mbastian Oct 15, 2015

Owner

Just to clarify, do you mean creating a "FileImporterBuilder" that is associated with ".zip" types?

Owner

mbastian commented Oct 15, 2015

Just to clarify, do you mean creating a "FileImporterBuilder" that is associated with ".zip" types?

@allfro

This comment has been minimized.

Show comment Hide comment
@allfro

allfro Oct 15, 2015

Yes

On Thursday, 15 October 2015, Mathieu Bastian notifications@github.com
wrote:

Just to clarify, do you mean creating a "FileImporterBuilder" that is
associated with ".zip" types?


Reply to this email directly or view it on GitHub
#737 (comment).

allfro commented Oct 15, 2015

Yes

On Thursday, 15 October 2015, Mathieu Bastian notifications@github.com
wrote:

Just to clarify, do you mean creating a "FileImporterBuilder" that is
associated with ".zip" types?


Reply to this email directly or view it on GitHub
#737 (comment).

@mbastian

This comment has been minimized.

Show comment Hide comment
@mbastian

mbastian Oct 15, 2015

Owner

Ok, I see. Unfortunately we built the Importer API so input files can be zipped. That's a convention we defined and didn't anticipate the need to support File importers that specifically specialize in opening zip files. I don't see a way to support this seamlessly but we should make it clear in the documentation what the "reserved" types are (zip, gzip, tar.gz etc.). An easy workaround would simply to rename the file into something specific such as "myzip", right?

Owner

mbastian commented Oct 15, 2015

Ok, I see. Unfortunately we built the Importer API so input files can be zipped. That's a convention we defined and didn't anticipate the need to support File importers that specifically specialize in opening zip files. I don't see a way to support this seamlessly but we should make it clear in the documentation what the "reserved" types are (zip, gzip, tar.gz etc.). An easy workaround would simply to rename the file into something specific such as "myzip", right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment