Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6579

Using the magnolia.upload.tmpdir directory for exporting XML content

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Neutral
    • None
    • 5.4.4
    • core
    • None
    • All OS
    • Yes

    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());

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              dunand Jean-Francois Nadeau
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoD

                  Time Tracking

                    Estimated:
                    Original Estimate - 1h
                    1h
                    Remaining:
                    Remaining Estimate - 1h
                    1h
                    Logged:
                    Time Spent - Not Specified
                    Not Specified