Bug 546366 - java.io.IOException: File name too long
Summary: java.io.IOException: File name too long
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 4.11.1   Edit
Hardware: PC CentOS
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-12 05:56 EDT by Hank Lin CLA
Modified: 2022-09-10 05:14 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hank Lin CLA 2019-04-12 05:56:20 EDT
Hi,

I use JGit function "CloneCommand.call()" to clone file,
but it throwed below exception: "java.io.IOException: File name too long ".

And there use traditional Chinese in file name,for example:
"這是中文字編碼長檔名測試這是中文字編碼長檔名測試這是中文字編碼長檔名測試這是中文字編碼長檔名測試這是中文字編碼長檔名測試這是中文字編碼長檔名測試.doc".

I found this patch : 
https://git.eclipse.org/r/#/c/95588/

It is to check the length of file name is over 200 character or not, but it may not work in some languages likes Chinese. 
One Chinese word would be 1~4 characters in encoding UTF-8. 

I think that there also needs to consider of above situation. 


Thanks.
Comment 1 Matthias Sohn CLA 2019-04-15 16:32:26 EDT
This exception is not thrown by JGit itself but is an IOException thrown by the underlying Java file implementation and is caused by a limitation of the filesystem you used. See e.g. https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits

In order to check this limit correctly we need a Java API to get the max file length limit of the underlying filesystem.
Comment 2 Anton Dzyk CLA 2022-09-10 05:14:41 EDT
Hi,

I'm fix this.

https://git.eclipse.org/r/c/jgit/jgit/+/95588/