Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368811

Summary: Keep extension of original file when create temporary file in method org.eclipse.jgit.dircache.DirCacheCheckout#checkoutEntry
Product: [Technology] JGit Reporter: Andrey Parfonov <andrew00x>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: christian.halstrick, matthias.sohn
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
The patch for requested improvement. none

Description Andrey Parfonov CLA 2012-01-17 06:10:28 EST
Build Identifier: 

We use JGit in online IDE. It is important for us to know the type of file. Type of file is determined from file extension when file is created (but not moved or copied). We track the creation of each file and keep some metadata e.g. media type of file.
Temporary file created without extension (method DirCacheCheckout#checkoutEntry) so the media type cannot be determined. When this file replace original file the media type of original file is lost.
It will be very helpful to keep extension of original file for temporary file. I guess it is very easy to do, see the attached patch. 

Reproducible: Always
Comment 1 Andrey Parfonov CLA 2012-01-17 06:12:39 EST
Created attachment 209610 [details]
The patch for requested improvement.
Comment 2 Matthias Sohn CLA 2015-11-27 18:14:02 EST
the temporary file is existing for a very short period of time only