Menu

#103 ExportUtil.exportAll() throws FileNotFoundException

Unassigned
wont-fix
nobody
None
1
2014-04-28
2014-04-24
No

When trying to use the ExportUtil.exportAll() method, a java.io.FileNotFoundException is thrown if the given directory does not have an existing file for every table.

Wouldn't it make sense for the exportAll() method to check whether a file exists for each table, and create said file if it does not exist?

I've attached a java file demonstrating the issue. Thanks (and your library is awesomely useful!)

1 Attachments

Discussion

  • James Ahlborn

    James Ahlborn - 2014-04-24

    Are you sure the directory exists? the export methods don't require the file to already exist, just the directory.

     
  • Evan Kaufman

    Evan Kaufman - 2014-04-24

    Yes, I checked and the directory exists and is world writable (chmod 777).

    I worked around it for now by iterating db.getTableNames() and creating empty csv files before calling exportAll().

     
    • James Ahlborn

      James Ahlborn - 2014-04-24

      can you include a stack trace, a table name, and the directory name?

      the code in question is just using "new FileWriter(File)", which will create the file if it doesn't currently exist.

      are you using a different user to run the program than the owner of the directory?

       

      Last edit: James Ahlborn 2014-04-24
      • Evan Kaufman

        Evan Kaufman - 2014-04-28

        I cannot seem to reproduce it now, and I suspect it may have been a user/permissions problem after all.

        Sorry!

         
  • James Ahlborn

    James Ahlborn - 2014-04-28
    • status: open --> wont-fix
     
  • James Ahlborn

    James Ahlborn - 2014-04-28

    no problem.

     

Log in to post a comment.