Giter Club home page Giter Club logo

carp's Issues

Failing to import files with paths that contain upper-case characters on systems with case-sensitive filenames (i.e. GNU/Linux)

Describe the bug
Failing to import files with paths that contain upper-case characters on systems with case-sensitive filenames (i.e. GNU/Linux).
There is no visible error in the GUI, however exception info is output to stderr (see "Log" section).

To Reproduce
Steps to reproduce the behavior (GNU/Linux):

  1. Go to 'In-Out-Settings'
  2. Drag-and-Drop a file with a path containing upper-case letters into the "Input File" box (or use the search button)

Log

[00:00:00] [SEVERE] [Thread-8:ExcelImporter:getInput] [Wahlverteiler] 
java.io.FileNotFoundException: /home/user/downloads/carp.xlsx (Datei oder Verzeichnis nicht gefunden)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at de.juhu.dateimanager.ExcelImporter.getInput(ExcelImporter.java:246)
    at de.juhu.dateimanager.ExcelImporter.readXLSXImproved(ExcelImporter.java:191)
    at de.juhu.distributor.Distributor.importFile(Distributor.java:1079)
    at de.juhu.distributor.Distributor.readFile(Distributor.java:1044)
    at de.juhu.distributor.Distributor.<init>(Distributor.java:170)
    at de.juhu.guiFX.GUIManager.lambda$onDragDroppedInput$0(GUIManager.java:646)
    at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-8" java.lang.NullPointerException
        at org.apache.poi.poifs.filesystem.FileMagic.prepareToCheckMagic(FileMagic.java:184)
        at org.apache.poi.openxml4j.opc.internal.ZipHelper.openZipStream(ZipHelper.java:174)
        at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:104)
        at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:301)
        at org.apache.poi.ooxml.util.PackageHelper.open(PackageHelper.java:37)
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:303)
        at de.juhu.dateimanager.ExcelImporter.readXLSXImproved(ExcelImporter.java:195)
        at de.juhu.distributor.Distributor.importFile(Distributor.java:1079)
        at de.juhu.distributor.Distributor.readFile(Distributor.java:1044)
        at de.juhu.distributor.Distributor.<init>(Distributor.java:170)
        at de.juhu.guiFX.GUIManager.lambda$onDragDroppedInput$0(GUIManager.java:646)
        at java.lang.Thread.run(Thread.java:748)

Desktop (please complete the following information):

  • OS: GNU/Linux

Additional context
The cause of the problem is that the input path unnecessarily gets converted to lower-case in the Distributor's importFile(String) method:

path = path.toLowerCase();

This works fine for systems where the lower-case path always represents the same file as the original path (although not even that can be guaranteed), but obviously results in a "file not found" error on systems with case-sensitive paths, i.e. Linux.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.