Ignore:
Timestamp:
2021-09-12T14:51:15+02:00 (3 years ago)
Author:
Don-vip
Message:

see #21257 - fix unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GpxWriter.java

    r18211 r18219  
    6161    private GpxData data;
    6262    private String indent = "";
     63    private Instant metaTime;
    6364    private List<String> validprefixes;
    6465
     
    6667    private static final int ROUTE_POINT = 1;
    6768    private static final int TRACK_POINT = 2;
     69
     70    /**
     71     * Returns the forced metadata time information, if any.
     72     * @return the forced metadata time information, or {@code null}
     73     * @since 18219
     74     */
     75    public Instant getMetaTime() {
     76        return metaTime;
     77    }
     78
     79    /**
     80     * Sets the forced metadata time information.
     81     * @param metaTime the forced metadata time information, or {@code null} to use the current time
     82     * @since 18219
     83     */
     84    public void setMetaTime(Instant metaTime) {
     85        this.metaTime = metaTime;
     86    }
    6887
    6988    /**
     
    105124            });
    106125        }
     126        data.put(META_TIME, (metaTime != null ? metaTime : Instant.now()).toString());
    107127        data.endUpdate();
    108128
     
    235255        }
    236256
    237         simpleTag("time", Instant.now().toString());
     257        // write the time
     258        if (attr.containsKey(META_TIME)) {
     259            simpleTag("time", data.getString(META_TIME));
     260        }
    238261
    239262        Bounds bounds = data.recalculateBounds();
Note: See TracChangeset for help on using the changeset viewer.