Skip to content

Archive creation fails if directory name is shorter than 3 characters #64

@michaelboyles

Description

@michaelboyles

File.createTempFile is called with the given directory's name as a prefix. If it's too short, this will fail with an IllegalArgumentException. The prefix should be padded so this doesn't happen.

File destinationFile = new File("/var/tmp/1")
File sourceFile = new File("/var/tmp/2")

Archiver arch = ArchiverFactory.createArchiver(ArchiveFormat.TAR, CompressionType.GZIP)
File archiveFile = arch.create("64cacf30-b294-49f4-b166-032a808d73cd", destinationFile, sourceFile)

See: https://stackoverflow.com/questions/48806562/java-io-file-prefix-string-too-short-but-its-not

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions