commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Wiedmann (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COMPRESS-120) forbidden chars on windows
Date Wed, 13 Oct 2010 14:00:34 GMT

    [ https://issues.apache.org/jira/browse/COMPRESS-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920566#action_12920566
] 

Jochen Wiedmann commented on COMPRESS-120:
------------------------------------------

I think that silently replacing characters by default is a very bad idea, at least in a programmatic
API like Commons Compress. Admittedly, command line tools like WinRAR, or 7-zip are a different
matter.

If I extract an archive programmatically, I expect the extracted contents to be identical,
not similar. In other words, if there are any invalid characters, then the only sensible approach
*by default* is to throw an IOException or something similar.

If the user *knows* that he wants to replace characters, then we might provide an implementation
of an interface like FileNameReplacer, or something similar. In my opinion, the default implementation
of FileNameReplacer is what would throw the IOException.


> forbidden chars on windows
> --------------------------
>
>                 Key: COMPRESS-120
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-120
>             Project: Commons Compress
>          Issue Type: Improvement
>          Components: Archivers
>    Affects Versions: 1.0
>         Environment: WindowsXP32bit
>            Reporter: Helmut Minst
>            Priority: Minor
>
> while uncompressing a tar archive, which includes files and directories containing special
characters like
> private char[] forbiddenCharsWindows = new char[] { ':', '*', '?', '"', '<', '>',
'|' }; the name of the tarEntry is corrupt
> and to create the directory or file is not possible. Exceptions occurs while creating
them.
> it would be better to replace them with '_'  instead to respond invalid entrynames.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message