Changeset 13485 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-03-03T16:20:56+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r13173 r13485 18 18 import org.openstreetmap.josm.data.osm.Changeset; 19 19 import org.openstreetmap.josm.data.osm.DataSet; 20 import org.openstreetmap.josm.data.osm.DataSet.DownloadPolicy; 20 21 import org.openstreetmap.josm.data.osm.DataSet.UploadPolicy; 21 22 import org.openstreetmap.josm.data.osm.INode; … … 90 91 } 91 92 93 /** 94 * Writes OSM header with normal download and upload policies. 95 */ 92 96 public void header() { 93 header(UploadPolicy.NORMAL); 94 } 95 97 header(DownloadPolicy.NORMAL, UploadPolicy.NORMAL); 98 } 99 100 /** 101 * Writes OSM header with normal download policy and given upload policy. 102 * @deprecated Use {@link #header(DownloadPolicy, UploadPolicy)} instead 103 * @param upload upload policy 104 */ 105 @Deprecated 96 106 public void header(UploadPolicy upload) { 107 header(DownloadPolicy.NORMAL, upload); 108 } 109 110 /** 111 * Writes OSM header with given download upload policies. 112 * @param download download policy 113 * @param upload upload policy 114 * @since 13485 115 */ 116 public void header(DownloadPolicy download, UploadPolicy upload) { 117 header(download, upload, false); 118 } 119 120 private void header(DownloadPolicy download, UploadPolicy upload, boolean locked) { 97 121 out.println("<?xml version='1.0' encoding='UTF-8'?>"); 98 122 out.print("<osm version='"); 99 123 out.print(version); 124 if (download != null && download != DownloadPolicy.NORMAL) { 125 out.print("' download='"); 126 out.print(download.getXmlFlag()); 127 } 100 128 if (upload != null && upload != UploadPolicy.NORMAL) { 101 129 out.print("' upload='"); 102 130 out.print(upload.getXmlFlag()); 103 131 } 132 if (locked) { 133 out.print("' locked=true"); 134 } 104 135 out.println("' generator='JOSM'>"); 105 136 } 106 137 138 /** 139 * Writes OSM footer. 140 */ 107 141 public void footer() { 108 142 out.println("</osm>"); … … 135 169 */ 136 170 public void write(DataSet data) { 137 header(data.get UploadPolicy());171 header(data.getDownloadPolicy(), data.getUploadPolicy(), data.isLocked()); 138 172 writeDataSources(data); 139 173 writeContent(data); -
trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java
r13204 r13485 24 24 import org.openstreetmap.josm.data.coor.LatLon; 25 25 import org.openstreetmap.josm.data.osm.DataSet; 26 import org.openstreetmap.josm.data.osm.DataSet.DownloadPolicy; 27 import org.openstreetmap.josm.data.osm.DataSet.UploadPolicy; 26 28 import org.openstreetmap.josm.data.osm.OsmPrimitive; 27 29 import org.openstreetmap.josm.data.osm.Relation; … … 158 160 OsmWriter w = OsmWriterFactory.createOsmWriter(new PrintWriter(writer), false, ds.getVersion()) 159 161 ) { 160 w.header(D ataSet.UploadPolicy.DISCOURAGED);162 w.header(DownloadPolicy.NORMAL, UploadPolicy.DISCOURAGED); 161 163 w.writeContent(ds); 162 164 w.footer();
Note:
See TracChangeset
for help on using the changeset viewer.