Uploaded image for project: 'Project Configurator - Development'
  1. Project Configurator - Development
  2. PCDEV-778

Add ability to handle invalid timestamps on attachment files.

    Details

    • Type: Bug
    • Status: Done (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.8-J7
    • Labels:
      None
    • Critical Points:
      0

      Description

      When trying to export  a project where it contains attachments that have an invalid last modified date which is before the 1st January 1970 or a date in the future then the export fails and gives a stack trace similar to below.

      With this change, if Project Configurator detects that an attachments has an incorrect "Last modified" date, it will copy the attachments without maintaining its metadata dates. Dates within Jira will not be affected by this.

      Stack trace:
      java.lang.IllegalArgumentException: Negative time
      at java.io.File.setLastModified(File.java:1427)
      at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1168)
      at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1446)
      at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1444)
      at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1444)
      at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1388)
      at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1268)
      at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1237)
      at com.awnaba.projectconfigurator.transporter.engine.JiraAttachmentExporter.exportAttachments(JiraAttachmentExporter.java:67)
      at com.awnaba.projectconfigurator.transporter.engine.CompleteExportTask.exportAttachments(CompleteExportTask.java:160)
      at com.awnaba.projectconfigurator.transporter.engine.CompleteExportTask.call(CompleteExportTask.java:103)
      at com.awnaba.projectconfigurator.transporter.engine.CompleteExportTask.call(CompleteExportTask.java:1)
      at com.awnaba.projectconfigurator.longrunningtasks.TaskHelper$WrappingTask.call(TaskHelper.java:75)
      at com.awnaba.projectconfigurator.longrunningtasks.TaskHelper$WrappingTask.call(TaskHelper.java:1)
      at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:458)
      at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:426)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:216)
      at java.lang.Thread.run(Thread.java:745)

        Attachments

          Structure

            Activity

              People

              Assignee:
              jrojo Jose Rojo [X] (Inactive)
              Reporter:
              kwalker Kristian Walker
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Structure Helper Panel