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

Add ability to handle invalid timestamps on attachment files.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • High
    • Resolution: Fixed
    • None
    • 2.3.8-J7
    • None
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: