Changeset 13352 in josm
- Timestamp:
- 2018-01-21T23:28:56+01:00 (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.classpath
r13342 r13352 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <classpath> 3 <classpathentry excluding="org/apache/commons/compress/ compressors/CompressorException.java|org/apache/commons/compress/compressors/CompressorStreamFactory.java|org/apache/commons/compress/compressors/CompressorStreamProvider.java|org/apache/commons/compress/compressors/FileNameUtil.java|org/apache/commons/compress/compressors/brotli/|org/apache/commons/compress/compressors/bzip2/BZip2Utils.java|org/apache/commons/compress/compressors/deflate/|org/apache/commons/compress/compressors/gzip/|org/apache/commons/compress/compressors/lz4/|org/apache/commons/compress/compressors/lz77support/|org/apache/commons/compress/compressors/lzma/|org/apache/commons/compress/compressors/pack200/|org/apache/commons/compress/compressors/snappy/|org/apache/commons/compress/compressors/xz/|org/apache/commons/compress/compressors/z/|org/apache/commons/compress/utils/ArchiveUtils.java|org/apache/commons/jcs/JCS.java|org/apache/commons/jcs/access/GroupCacheAccess.java|org/apache/commons/jcs/access/PartitionedCacheAccess.java|org/apache/commons/jcs/access/behavior/IGroupCacheAccess.java|org/apache/commons/jcs/access/exception/InvalidGroupException.java|org/apache/commons/jcs/admin/servlet/|org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCacheMonitor.java|org/apache/commons/jcs/auxiliary/disk/jdbc/|org/apache/commons/jcs/auxiliary/lateral/|org/apache/commons/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java|org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheListener.java|org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java|org/apache/commons/jcs/auxiliary/remote/RemoteCache.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheFactory.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheListener.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheManager.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheMonitor.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWait.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheRestore.java|org/apache/commons/jcs/auxiliary/remote/http/|org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java|org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMISocketFactory.java|org/apache/commons/jcs/engine/CacheAdaptor.java|org/apache/commons/jcs/engine/CacheGroup.java|org/apache/commons/jcs/engine/CacheWatchRepairable.java|org/apache/commons/jcs/engine/ZombieCacheService.java|org/apache/commons/jcs/engine/ZombieCacheServiceNonLocal.java|org/apache/commons/jcs/engine/ZombieCacheWatch.java|org/apache/commons/jcs/engine/logging/CacheEventLoggerDebugLogger.java|org/apache/commons/jcs/utils/access/|org/apache/commons/jcs/utils/discovery/|org/apache/commons/jcs/utils/net/|org/apache/commons/jcs/utils/props/|org/apache/commons/jcs/utils/servlet/|org/apache/commons/logging/impl/AvalonLogger.java|org/apache/commons/logging/impl/Jdk13LumberjackLogger.java|org/apache/commons/logging/impl/Log4JLogger.java|org/apache/commons/logging/impl/LogKitLogger.java|org/apache/commons/logging/impl/ServletContextCleaner.java|org/openstreetmap/gui/jmapviewer/Demo.java|org/openstreetmap/gui/jmapviewer/JMapViewerTree.java|org/openstreetmap/gui/jmapviewer/checkBoxTree/|org/apache/commons/compress/archivers/|org/apache/commons/compress/changes/|org/apache/commons/compress/parallel/|org/apache/commons/compress/PasswordRequiredException.java|org/apache/commons/compress/compressors/zstandard/" kind="src" path="src"/>3 <classpathentry excluding="org/apache/commons/compress/PasswordRequiredException.java|org/apache/commons/compress/archivers/|org/apache/commons/compress/changes/|org/apache/commons/compress/compressors/CompressorException.java|org/apache/commons/compress/compressors/CompressorStreamFactory.java|org/apache/commons/compress/compressors/CompressorStreamProvider.java|org/apache/commons/compress/compressors/FileNameUtil.java|org/apache/commons/compress/compressors/brotli/|org/apache/commons/compress/compressors/bzip2/BZip2Utils.java|org/apache/commons/compress/compressors/deflate/|org/apache/commons/compress/compressors/gzip/|org/apache/commons/compress/compressors/lz4/|org/apache/commons/compress/compressors/lz77support/|org/apache/commons/compress/compressors/lzma/|org/apache/commons/compress/compressors/pack200/|org/apache/commons/compress/compressors/snappy/|org/apache/commons/compress/compressors/xz/XZUtils.java|org/apache/commons/compress/compressors/z/|org/apache/commons/compress/compressors/zstandard/|org/apache/commons/compress/parallel/|org/apache/commons/compress/utils/ArchiveUtils.java|org/apache/commons/jcs/JCS.java|org/apache/commons/jcs/access/GroupCacheAccess.java|org/apache/commons/jcs/access/PartitionedCacheAccess.java|org/apache/commons/jcs/access/behavior/IGroupCacheAccess.java|org/apache/commons/jcs/access/exception/InvalidGroupException.java|org/apache/commons/jcs/admin/servlet/|org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCacheMonitor.java|org/apache/commons/jcs/auxiliary/disk/jdbc/|org/apache/commons/jcs/auxiliary/lateral/|org/apache/commons/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java|org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheListener.java|org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java|org/apache/commons/jcs/auxiliary/remote/RemoteCache.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheFactory.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheListener.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheManager.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheMonitor.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWait.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java|org/apache/commons/jcs/auxiliary/remote/RemoteCacheRestore.java|org/apache/commons/jcs/auxiliary/remote/http/|org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java|org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMISocketFactory.java|org/apache/commons/jcs/engine/CacheAdaptor.java|org/apache/commons/jcs/engine/CacheGroup.java|org/apache/commons/jcs/engine/CacheWatchRepairable.java|org/apache/commons/jcs/engine/ZombieCacheService.java|org/apache/commons/jcs/engine/ZombieCacheServiceNonLocal.java|org/apache/commons/jcs/engine/ZombieCacheWatch.java|org/apache/commons/jcs/engine/logging/CacheEventLoggerDebugLogger.java|org/apache/commons/jcs/utils/access/|org/apache/commons/jcs/utils/discovery/|org/apache/commons/jcs/utils/net/|org/apache/commons/jcs/utils/props/|org/apache/commons/jcs/utils/servlet/|org/apache/commons/logging/impl/AvalonLogger.java|org/apache/commons/logging/impl/Jdk13LumberjackLogger.java|org/apache/commons/logging/impl/Log4JLogger.java|org/apache/commons/logging/impl/LogKitLogger.java|org/apache/commons/logging/impl/ServletContextCleaner.java|org/openstreetmap/gui/jmapviewer/Demo.java|org/openstreetmap/gui/jmapviewer/JMapViewerTree.java|org/openstreetmap/gui/jmapviewer/checkBoxTree/" kind="src" path="src"/> 4 4 <classpathentry including="data/|images/|resources/|styles/" kind="src" path=""/> 5 5 <classpathentry kind="src" path="test/unit"/> -
trunk/build.xml
r13351 r13352 242 242 <target name="compile-cots" depends="init"> 243 243 <!-- COTS --> 244 <javac srcdir="${src.dir}" includes="com/**,javax/**,oauth/**,org/apache/commons/**,org/glassfish/**, gnu/**" nowarn="on" encoding="iso-8859-1"244 <javac srcdir="${src.dir}" includes="com/**,javax/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/tukaani/**,gnu/**" nowarn="on" encoding="iso-8859-1" 245 245 destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeAntRuntime="false" createMissingPackageInfoClass="false"> 246 246 <!-- get rid of "internal proprietary API" warning --> … … 262 262 <exclude name="org/apache/commons/compress/compressors/pack200/**"/> 263 263 <exclude name="org/apache/commons/compress/compressors/snappy/**"/> 264 <exclude name="org/apache/commons/compress/compressors/xz/XZUtils.java"/> 264 265 <exclude name="org/apache/commons/compress/compressors/z/**"/> 265 266 <exclude name="org/apache/commons/compress/compressors/zstandard/**"/> … … 296 297 <!-- JMapViewer --> 297 298 <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}" 298 excludes="com/**,javax/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java,org/openstreetmap/gui/jmapviewer/JMapViewerTree.java,org/openstreetmap/gui/jmapviewer/checkBoxTree/**,org/openstreetmap/josm/**, gnu/**"299 excludes="com/**,javax/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java,org/openstreetmap/gui/jmapviewer/JMapViewerTree.java,org/openstreetmap/gui/jmapviewer/checkBoxTree/**,org/openstreetmap/josm/**,org/tukaani/**,gnu/**" 299 300 destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8"> 300 301 <compilerclasspath> … … 322 323 <!-- JOSM --> 323 324 <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}" 324 excludes="com/**,javax/**,gnu/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/** "325 excludes="com/**,javax/**,gnu/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**,org/tukaani/**" 325 326 destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8"> 326 327 <compilerclasspath> -
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r13350 r13352 103 103 org.openstreetmap.josm.gui.io.importexport.OsmGzipExporter.class, 104 104 org.openstreetmap.josm.gui.io.importexport.OsmBzip2Exporter.class, 105 org.openstreetmap.josm.gui.io.importexport.OsmXzExporter.class, 105 106 org.openstreetmap.josm.gui.io.importexport.GeoJSONExporter.class, 106 107 org.openstreetmap.josm.gui.io.importexport.WMSLayerExporter.class, -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTask.java
r12679 r13352 27 27 import org.openstreetmap.josm.io.BoundingBoxDownloader; 28 28 import org.openstreetmap.josm.io.BoundingBoxDownloader.MoreNotesException; 29 import org.openstreetmap.josm.io.Compression; 29 30 import org.openstreetmap.josm.io.OsmApi; 30 31 import org.openstreetmap.josm.io.OsmServerLocationReader; … … 47 48 /** Property defining number of days a bug needs to be closed to no longer be downloaded */ 48 49 public static final IntegerProperty DAYS_CLOSED = new IntegerProperty("osm.notes.daysClosed", 7); 50 51 private static final String PATTERN_COMPRESS = "https?://.*/(.*\\.osn.(gz|xz|bz2?|zip))"; 49 52 50 53 private DownloadTask downloadTask; … … 71 74 @Override 72 75 public Future<?> loadUrl(boolean newLayer, String url, ProgressMonitor progressMonitor) { 73 if (url. endsWith(".bz2")) {74 downloadTask = new Download Bzip2RawUrlTask(new OsmServerLocationReader(url), progressMonitor);76 if (url.matches(PATTERN_COMPRESS)) { 77 downloadTask = new DownloadCompressedRawUrlTask(new OsmServerLocationReader(url), progressMonitor, Compression.byExtension(url)); 75 78 } else { 76 79 downloadTask = new DownloadRawUrlTask(new OsmServerLocationReader(url), progressMonitor); … … 210 213 } 211 214 212 class DownloadBzip2RawUrlTask extends DownloadTask { 213 214 DownloadBzip2RawUrlTask(OsmServerReader reader, ProgressMonitor progressMonitor) { 215 class DownloadCompressedRawUrlTask extends DownloadTask { 216 217 private final Compression compression; 218 219 DownloadCompressedRawUrlTask(OsmServerReader reader, ProgressMonitor progressMonitor, Compression compression) { 215 220 super(reader, progressMonitor); 221 this.compression = compression; 216 222 } 217 223 … … 223 229 ProgressMonitor subMonitor = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false); 224 230 try { 225 notesData = reader.parseRawNotes Bzip2(subMonitor);231 notesData = reader.parseRawNotes(subMonitor, compression); 226 232 } catch (OsmTransferException e) { 227 233 if (isCanceled()) -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeCompressedTask.java
r12634 r13352 9 9 import org.openstreetmap.josm.gui.MainApplication; 10 10 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 11 import org.openstreetmap.josm.io.Compression; 11 12 import org.openstreetmap.josm.io.OsmServerLocationReader; 12 13 import org.openstreetmap.josm.io.OsmTransferException; 13 14 14 15 /** 15 * Task allowing to download compressed OSM-Change files (gzip and bzip2)16 * Task allowing to download compressed OSM-Change files (gzip, xz and bzip2) 16 17 * @since 5361 17 18 */ 18 19 public class DownloadOsmChangeCompressedTask extends DownloadOsmChangeTask { 19 20 21 private static final String PATTERN_COMPRESS = "https?://.*/(.*\\.osc.(gz|xz|bz2?|zip))"; 22 20 23 @Override 21 24 public String[] getPatterns() { 22 return new String[]{ "https?://.*/.*\\.osc.(gz|bz2?)"};25 return new String[]{PATTERN_COMPRESS}; 23 26 } 24 27 … … 40 43 protected DataSet parseDataSet() throws OsmTransferException { 41 44 ProgressMonitor subTaskMonitor = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false); 42 if (url.matches("https?://.*/.*\\.osc.bz2?")) { 43 return reader.parseOsmChangeBzip2(subTaskMonitor); 44 } else { 45 return reader.parseOsmChangeGzip(subTaskMonitor); 46 } 45 return reader.parseOsmChange(subTaskMonitor, Compression.byExtension(url)); 47 46 } 48 47 }; 49 48 currentBounds = null; 50 // Extract .osc.gz/ bz/bz2filename from URL to set the new layer name51 extractOsmFilename( "https?://.*/(.*\\.osc.(gz|bz2?))", url);49 // Extract .osc.gz/xz/bz/bz2/zip filename from URL to set the new layer name 50 extractOsmFilename(PATTERN_COMPRESS, url); 52 51 return MainApplication.worker.submit(downloadTask); 53 52 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmCompressedTask.java
r12634 r13352 10 10 import org.openstreetmap.josm.gui.MainApplication; 11 11 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 12 import org.openstreetmap.josm.io.Compression; 12 13 import org.openstreetmap.josm.io.OsmServerLocationReader; 13 14 import org.openstreetmap.josm.io.OsmTransferException; 14 15 15 16 /** 16 * Task allowing to download compressed OSM files (gzip and bzip2)17 * Task allowing to download compressed OSM files (gzip, xz and bzip2) 17 18 * @since 5317 18 19 */ 19 20 public class DownloadOsmCompressedTask extends DownloadOsmTask { 20 21 21 private static final String PATTERN_COMPRESS = "https?://.*/ .*\\.osm.(gz|bz2?|zip)";22 private static final String PATTERN_COMPRESS = "https?://.*/(.*\\.osm\\.(gz|xz|bz2?|zip))"; 22 23 23 24 @Override … … 32 33 33 34 @Override 34 public Future<?> download(boolean newLayer, Bounds downloadArea, 35 ProgressMonitor progressMonitor) { 35 public Future<?> download(boolean newLayer, Bounds downloadArea, ProgressMonitor progressMonitor) { 36 36 return null; 37 37 } … … 49 49 protected DataSet parseDataSet() throws OsmTransferException { 50 50 ProgressMonitor subTaskMonitor = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false); 51 if (url.matches("https?://.*/.*\\.osm.bz2?")) { 52 return reader.parseOsmBzip2(subTaskMonitor); 53 } else if (url.matches("https?://.*/.*\\.osm.gz")) { 54 return reader.parseOsmGzip(subTaskMonitor); 55 } else { 56 return reader.parseOsmZip(subTaskMonitor); 57 } 51 return reader.parseOsm(subTaskMonitor, Compression.byExtension(url)); 58 52 } 59 53 }; 60 54 currentBounds = null; 61 55 // Extract .osm.gz/bz/bz2/zip filename from URL to set the new layer name 62 extractOsmFilename( "https?://.*/(.*\\.osm.(gz|bz2?|zip))", url);56 extractOsmFilename(PATTERN_COMPRESS, url); 63 57 return MainApplication.worker.submit(downloadTask); 64 58 } -
trunk/src/org/openstreetmap/josm/gui/io/importexport/NoteImporter.java
r13114 r13352 20 20 21 21 /** 22 * File importer that reads note dump files (*.osn, .osn.gz and .osn.bz2)22 * File importer that reads note dump files (*.osn, .osn.gz, .osn.xz and .osn.bz2) 23 23 * @since 7538 24 24 */ -
trunk/src/org/openstreetmap/josm/gui/io/importexport/OsmExporter.java
r12846 r13352 124 124 125 125 protected void doSave(File file, OsmDataLayer layer) throws IOException { 126 // create outputstream and wrap it with gzip or bzip, if necessary126 // create outputstream and wrap it with gzip, xz or bzip, if necessary 127 127 try ( 128 128 OutputStream out = getOutputStream(file); -
trunk/src/org/openstreetmap/josm/gui/io/importexport/OsmImporter.java
r12671 r13352 33 33 */ 34 34 public static final ExtensionFileFilter FILE_FILTER = ExtensionFileFilter.newFilterWithArchiveExtensions( 35 "osm,xml", "osm", tr("OSM Server Files") + " (*.osm, *.osm.gz, *.osm.bz2, *.osm. zip, *.xml)",36 ExtensionFileFilter.AddArchiveExtension.NONE, Arrays.asList("gz", "bz", "bz2", " zip"));35 "osm,xml", "osm", tr("OSM Server Files") + " (*.osm, *.osm.gz, *.osm.bz2, *.osm.xz, *.osm.zip, *.xml)", 36 ExtensionFileFilter.AddArchiveExtension.NONE, Arrays.asList("gz", "bz", "bz2", "xz", "zip")); 37 37 38 38 /** -
trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java
r12679 r13352 84 84 */ 85 85 public enum NoteUrlPattern { 86 /** URL of OSM API Notes endpoint */ 86 87 API_URL ("https?://.*/api/0.6/notes.*"), 87 DUMP_FILE("https?://.*/(.*\\.osn(.bz2)?)"); 88 /** URL of OSM API Notes compressed dump file */ 89 DUMP_FILE("https?://.*/(.*\\.osn(\\.(gz|xz|bz2?|zip))?)"); 88 90 89 91 private final String urlPattern; … … 147 149 148 150 @Override 149 public DataSet parseOsm(final ProgressMonitor progressMonitor) throws OsmTransferException { 150 return doParse(new OsmParser(progressMonitor, Compression.NONE), progressMonitor); 151 } 152 153 @Override 154 public DataSet parseOsmBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { 155 return doParse(new OsmParser(progressMonitor, Compression.BZIP2), progressMonitor); 156 } 157 158 @Override 159 public DataSet parseOsmGzip(final ProgressMonitor progressMonitor) throws OsmTransferException { 160 return doParse(new OsmParser(progressMonitor, Compression.GZIP), progressMonitor); 161 } 162 163 @Override 164 public DataSet parseOsmZip(final ProgressMonitor progressMonitor) throws OsmTransferException { 165 return doParse(new OsmParser(progressMonitor, Compression.ZIP), progressMonitor); 166 } 167 168 @Override 169 public DataSet parseOsmChange(final ProgressMonitor progressMonitor) throws OsmTransferException { 170 return doParse(new OsmChangeParser(progressMonitor, Compression.NONE), progressMonitor); 171 } 172 173 @Override 174 public DataSet parseOsmChangeBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { 175 return doParse(new OsmChangeParser(progressMonitor, Compression.BZIP2), progressMonitor); 176 } 177 178 @Override 179 public DataSet parseOsmChangeGzip(final ProgressMonitor progressMonitor) throws OsmTransferException { 180 return doParse(new OsmChangeParser(progressMonitor, Compression.GZIP), progressMonitor); 181 } 182 183 @Override 184 public GpxData parseRawGps(final ProgressMonitor progressMonitor) throws OsmTransferException { 185 return doParse(new GpxParser(progressMonitor, Compression.NONE), progressMonitor); 186 } 187 188 @Override 189 public GpxData parseRawGpsBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { 190 return doParse(new GpxParser(progressMonitor, Compression.BZIP2), progressMonitor); 191 } 192 193 @Override 194 public List<Note> parseRawNotes(final ProgressMonitor progressMonitor) throws OsmTransferException { 195 return doParse(new NoteParser(progressMonitor, Compression.NONE), progressMonitor); 196 } 197 198 @Override 199 public List<Note> parseRawNotesBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { 200 return doParse(new NoteParser(progressMonitor, Compression.BZIP2), progressMonitor); 151 public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException { 152 return parseOsm(progressMonitor, Compression.NONE); 153 } 154 155 @Override 156 public DataSet parseOsm(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 157 return doParse(new OsmParser(progressMonitor, compression), progressMonitor); 158 } 159 160 @Override 161 public DataSet parseOsmChange(ProgressMonitor progressMonitor) throws OsmTransferException { 162 return parseOsmChange(progressMonitor, Compression.NONE); 163 } 164 165 @Override 166 public DataSet parseOsmChange(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 167 return doParse(new OsmChangeParser(progressMonitor, compression), progressMonitor); 168 } 169 170 @Override 171 public GpxData parseRawGps(ProgressMonitor progressMonitor) throws OsmTransferException { 172 return parseRawGps(progressMonitor, Compression.NONE); 173 } 174 175 @Override 176 public GpxData parseRawGps(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 177 return doParse(new GpxParser(progressMonitor, compression), progressMonitor); 178 } 179 180 @Override 181 public List<Note> parseRawNotes(ProgressMonitor progressMonitor) throws OsmTransferException { 182 return parseRawNotes(progressMonitor, Compression.NONE); 183 } 184 185 @Override 186 public List<Note> parseRawNotes(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 187 return doParse(new NoteParser(progressMonitor, compression), progressMonitor); 201 188 } 202 189 -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r12992 r13352 127 127 * @param reason The reason to show on console. Can be {@code null} if no reason is given 128 128 * @param uncompressAccordingToContentDisposition Whether to inspect the HTTP header {@code Content-Disposition} 129 * for {@code filename} and uncompress a gzip/bzip2 stream.129 * for {@code filename} and uncompress a gzip/bzip2/xz/zip stream. 130 130 * @return An reader reading the input stream (servers answer) or <code>null</code>. 131 131 * @throws OsmTransferException if data transfer errors occur … … 143 143 * @param reason The reason to show on console. Can be {@code null} if no reason is given 144 144 * @param uncompressAccordingToContentDisposition Whether to inspect the HTTP header {@code Content-Disposition} 145 * for {@code filename} and uncompress a gzip/bzip2 stream.145 * for {@code filename} and uncompress a gzip/bzip2/xz/zip stream. 146 146 * @param httpMethod HTTP method ("GET", "POST" or "PUT") 147 147 * @param requestBody HTTP request body (for "POST" and "PUT" methods only). Must be null for "GET" method. … … 248 248 249 249 /** 250 * Download OSM Change files from somewhere 251 * @param progressMonitor The progress monitor 252 * @return The corresponding dataset 253 * @throws OsmTransferException if any error occurs 254 */ 255 public DataSet parseOsmChange(final ProgressMonitor progressMonitor) throws OsmTransferException { 250 * Download compressed OSM files from somewhere 251 * @param progressMonitor The progress monitor 252 * @param compression compression to use 253 * @return The corresponding dataset 254 * @throws OsmTransferException if any error occurs 255 * @since 13352 256 */ 257 public DataSet parseOsm(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 258 return null; 259 } 260 261 /** 262 * Download OSM Change uncompressed files from somewhere 263 * @param progressMonitor The progress monitor 264 * @return The corresponding dataset 265 * @throws OsmTransferException if any error occurs 266 */ 267 public DataSet parseOsmChange(ProgressMonitor progressMonitor) throws OsmTransferException { 268 return null; 269 } 270 271 /** 272 * Download OSM Change compressed files from somewhere 273 * @param progressMonitor The progress monitor 274 * @param compression compression to use 275 * @return The corresponding dataset 276 * @throws OsmTransferException if any error occurs 277 * @since 13352 278 */ 279 public DataSet parseOsmChange(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 256 280 return null; 257 281 } … … 262 286 * @return The corresponding dataset 263 287 * @throws OsmTransferException if any error occurs 264 */ 265 public DataSet parseOsmChangeBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { 266 return null; 288 * @deprecated use {@link #parseOsmChange(ProgressMonitor, Compression)} instead 289 */ 290 @Deprecated 291 public DataSet parseOsmChangeBzip2(ProgressMonitor progressMonitor) throws OsmTransferException { 292 return parseOsmChange(progressMonitor, Compression.BZIP2); 267 293 } 268 294 … … 272 298 * @return The corresponding dataset 273 299 * @throws OsmTransferException if any error occurs 274 */ 275 public DataSet parseOsmChangeGzip(final ProgressMonitor progressMonitor) throws OsmTransferException { 276 return null; 300 * @deprecated use {@link #parseOsmChange(ProgressMonitor, Compression)} instead 301 */ 302 @Deprecated 303 public DataSet parseOsmChangeGzip(ProgressMonitor progressMonitor) throws OsmTransferException { 304 return parseOsmChange(progressMonitor, Compression.GZIP); 277 305 } 278 306 … … 283 311 * @throws OsmTransferException if any error occurs 284 312 */ 285 public GpxData parseRawGps(final ProgressMonitor progressMonitor) throws OsmTransferException { 313 public GpxData parseRawGps(ProgressMonitor progressMonitor) throws OsmTransferException { 314 return null; 315 } 316 317 /** 318 * Retrieve compressed GPX files from somewhere. 319 * @param progressMonitor The progress monitor 320 * @param compression compression to use 321 * @return The corresponding GPX tracks 322 * @throws OsmTransferException if any error occurs 323 * @since 13352 324 */ 325 public GpxData parseRawGps(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 286 326 return null; 287 327 } … … 292 332 * @return The corresponding GPX tracks 293 333 * @throws OsmTransferException if any error occurs 334 * @deprecated use {@link #parseRawGps(ProgressMonitor, Compression)} instead 294 335 * @since 6244 295 336 */ 296 public GpxData parseRawGpsBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { 297 return null; 337 @Deprecated 338 public GpxData parseRawGpsBzip2(ProgressMonitor progressMonitor) throws OsmTransferException { 339 return parseRawGps(progressMonitor, Compression.BZIP2); 298 340 } 299 341 … … 303 345 * @return The corresponding dataset 304 346 * @throws OsmTransferException if any error occurs 305 */ 306 public DataSet parseOsmBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { 307 return null; 347 * @deprecated use {@link #parseOsm(ProgressMonitor, Compression)} instead 348 */ 349 @Deprecated 350 public DataSet parseOsmBzip2(ProgressMonitor progressMonitor) throws OsmTransferException { 351 return parseOsm(progressMonitor, Compression.BZIP2); 308 352 } 309 353 … … 313 357 * @return The corresponding dataset 314 358 * @throws OsmTransferException if any error occurs 315 */ 316 public DataSet parseOsmGzip(final ProgressMonitor progressMonitor) throws OsmTransferException { 317 return null; 359 * @deprecated use {@link #parseOsm(ProgressMonitor, Compression)} instead 360 */ 361 @Deprecated 362 public DataSet parseOsmGzip(ProgressMonitor progressMonitor) throws OsmTransferException { 363 return parseOsm(progressMonitor, Compression.GZIP); 318 364 } 319 365 … … 323 369 * @return The corresponding dataset 324 370 * @throws OsmTransferException if any error occurs 371 * @deprecated use {@link #parseOsm(ProgressMonitor, Compression)} instead 325 372 * @since 6882 326 373 */ 374 @Deprecated 327 375 public DataSet parseOsmZip(final ProgressMonitor progressMonitor) throws OsmTransferException { 328 return null;376 return parseOsm(progressMonitor, Compression.ZIP); 329 377 } 330 378 … … 385 433 386 434 /** 435 * Download notes from a URL that contains a compressed notes dump file 436 * @param progressMonitor progress monitor 437 * @param compression compression to use 438 * @return A list of notes parsed from the URL 439 * @throws OsmTransferException if any error occurs during dialog with OSM API 440 * @since 13352 441 */ 442 public List<Note> parseRawNotes(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 443 return null; 444 } 445 446 /** 387 447 * Download notes from a URL that contains a bzip2 compressed notes dump file 388 448 * @param progressMonitor progress monitor 389 449 * @return A list of notes parsed from the URL 390 450 * @throws OsmTransferException if any error occurs during dialog with OSM API 391 */ 451 * @deprecated Use {@link #parseRawNotes(ProgressMonitor, Compression)} instead 452 */ 453 @Deprecated 392 454 public List<Note> parseRawNotesBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException { 393 return null;455 return parseRawNotes(progressMonitor, Compression.BZIP2); 394 456 } 395 457 -
trunk/test/unit/org/openstreetmap/josm/actions/ExtensionFileFilterTest.java
r13079 r13352 9 9 10 10 import nl.jqno.equalsverifier.EqualsVerifier; 11 import nl.jqno.equalsverifier.Warning;12 11 13 12 /** … … 31 30 public void testNewFilterWithArchiveExtensions() { 32 31 test("ext1", "ext1", "description", true, 33 "ext1,ext1.gz,ext1.bz2", "description (*.ext1, *.ext1.gz, *.ext1.bz2)"); 32 "ext1,ext1.gz,ext1.bz,ext1.bz2,ext1.xz,ext1.zip", 33 "description (*.ext1, *.ext1.gz, *.ext1.bz, *.ext1.bz2, *.ext1.xz, *.ext1.zip)"); 34 34 test("ext1", "ext1", "description", false, 35 "ext1,ext1.gz,ext1.bz 2", "description (*.ext1)");35 "ext1,ext1.gz,ext1.bz,ext1.bz2,ext1.xz,ext1.zip", "description (*.ext1)"); 36 36 test("ext1,ext2", "ext1", "description", true, 37 "ext1,ext1.gz,ext1.bz2,ext2,ext2.gz,ext2.bz2", "description (*.ext1, *.ext1.gz, *.ext1.bz2, *.ext2, *.ext2.gz, *.ext2.bz2)"); 37 "ext1,ext1.gz,ext1.bz,ext1.bz2,ext1.xz,ext1.zip,ext2,ext2.gz,ext2.bz,ext2.bz2,ext2.xz,ext2.zip", 38 "description (*.ext1, *.ext1.gz, *.ext1.bz, *.ext1.bz2, *.ext1.xz, *.ext1.zip, " + 39 "*.ext2, *.ext2.gz, *.ext2.bz, *.ext2.bz2, *.ext2.xz, *.ext2.zip)"); 38 40 test("ext1,ext2", "ext1", "description", false, 39 "ext1,ext1.gz,ext1.bz2,ext2,ext2.gz,ext2.bz2", "description (*.ext1, *.ext2)"); 41 "ext1,ext1.gz,ext1.bz,ext1.bz2,ext1.xz,ext1.zip,ext2,ext2.gz,ext2.bz,ext2.bz2,ext2.xz,ext2.zip", 42 "description (*.ext1, *.ext2)"); 40 43 } 41 44 … … 47 50 TestUtils.assumeWorkingEqualsVerifier(); 48 51 EqualsVerifier.forClass(ExtensionFileFilter.class).usingGetClass() 49 .suppress(Warning.ANNOTATION) // FIXME: remove it after https://github.com/jqno/equalsverifier/issues/152 is fixed50 52 .verify(); 51 53 }
Note:
See TracChangeset
for help on using the changeset viewer.