Giter VIP home page Giter VIP logo

Comments (12)

johnscancella avatar johnscancella commented on June 23, 2024

Hi @nkrabben
I am curious, what kind of files are you trying to bag that contain \r?

from bagger.

johnscancella avatar johnscancella commented on June 23, 2024

Could you also provide a sample file or a set of directions to reproduce the issue?

from bagger.

nkrabben avatar nkrabben commented on June 23, 2024

The files are Mac Icon files from a born-digital collection that we're processing.

Apparently, it's fairly common for their file names to end with \r although from the sample we're looking at, it's not consistent. Since it's a problem with the file name and not the content, I've been creating test files through bash.
touch "Icon^M"

from bagger.

johnscancella avatar johnscancella commented on June 23, 2024

Looks like this is due to the underlying bagit-java library which should be percent encoding the filename and decoding it when verifying. See LibraryOfCongress/bagit-java#51

from bagger.

johnscancella avatar johnscancella commented on June 23, 2024

@nkrabben take a look at https://github.com/LibraryOfCongress/bagger/releases/tag/v2.7.1 it should fix your problem.

from bagger.

nkrabben avatar nkrabben commented on June 23, 2024

Bagger 2.7.1 is crashing before it finishes loading. I get a few different errors.
Loading from the command line I get
Error: Could not find or load main class 2.
Loading from Finder I get
An illegal state occured.

I can still load 2.7.0

from bagger.

johnscancella avatar johnscancella commented on June 23, 2024

Sorry, I was impatient and built it without all the dependencies. I deleted the old version on the releases page and uploaded the new file. I also included the MD5 and SHA1 checksum so you can test and make sure you have the right version.

from bagger.

nkrabben avatar nkrabben commented on June 23, 2024

New error
Could not find or load main class 3

from bagger.

johnscancella avatar johnscancella commented on June 23, 2024

Really? I just tried running it and it was fine. Did you delete the old one? Could you add the log files so I can see exactly what happened?

from bagger.

nkrabben avatar nkrabben commented on June 23, 2024

Looks like it was my error. Deleted everything and Bagger loaded fine.

While testing the filename handling, I noticed a new edge case. Bagging a folder that contains "Icon\r" works as expected, but adding "Icon\r" directly to the payload gives the following error:
Error adding bag file: ~/Desktop/Icon
due to:
Can't read ~/Desktop/Icon

from bagger.

johnscancella avatar johnscancella commented on June 23, 2024

It looks like it is a bug in the JDK rt.jar supplied code. Specifically BasicFileChooserUI's inner class ApproveSelectionAction. The code is repeated here for easy viewing:

if (filename != null) {
    // Remove whitespaces from end of filename
        int i = filename.length() - 1;

        while (i >=0 && filename.charAt(i) <= ' ') {
            i--;
        }

        filename = filename.substring(0, i + 1);
}

This code as the comment suggests removes any whitespace at the end of a file name. In this case that is not the correct behavior. I will try and file a bug with the Java developers and post a link here.

from bagger.

johnscancella avatar johnscancella commented on June 23, 2024

Oracle has created a bug based on my report
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8160540

from bagger.

Related Issues (20)

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.