[MAGNOLIA-6579] Using the magnolia.upload.tmpdir directory for exporting XML content Created: 03/Mar/16  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 5.4.4
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Jean-Francois Nadeau Assignee: Unassigned
Resolution: Won't Do Votes: 1
Labels: None
Remaining Estimate: 1h
Time Spent: Not Specified
Original Estimate: 1h
Environment:

All OS


Attachments: Java Source File DataTransporter.java    
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

When we use the XML export feature in Magnolia. Magnolia will create a temporary file to import the XML. By default Magnolia will create a temporary file in the default temp directory of the OS. Usually temp directories are:
Linux: /tmp
Windows: %USERPROFILE%\AppData\Local\Temp

In our enterprise system admins create 500Mb partitions for /tmp. The /tmp directory is also naturally fill with scrap files. We hit some problems when a user want to export a large content file and the /tmp partition become full. It would be more manageable if Magnolia were using the directory specified in magnolia.upload.tmpdir. In older version of Magnolia we manually patched our Magnolia-core jar with a fix to use the Magnolia temp directory instead of the default OS directory. It's just one line of code to replace. It was tested in Windows and Linux.

Fix:
magnolia-core in info\magnolia\importexport\DataTransporter.java line 512 in version 5.4.4 :

//will use the temp directory of the OS. On Linux it's /tmp
File tempFile = File.createTempFile("export-" + repository + session.getUserID(), ".xml");

//FIX: will use the temp directory specified with magnolia.upload.tmpdir
File tempFile = File.createTempFile("export-" + repository + session.getUserID(), ".xml", Path.getTempDirectory());



 Comments   
Comment by Jean-Francois Nadeau [ 03/Mar/16 ]

I uploaded the DataTransporter.java fixed to use the magnolia.upload.tmpdir variable instead of the default OS temp directory

Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

Generated at Mon Feb 12 04:15:50 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.