Ignore:
Timestamp:
2009-12-04T15:53:55+01:00 (14 years ago)
Author:
Gubaer
Message:

fixed #3684: Add "chunked" upload mode
Removed support for API "0.5" when uploading (there are still 0.5-files around, but I'm not aware of any 0.5-servers)

File:
1 edited

Legend:

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

    r2512 r2569  
    4444    private Collection<OsmPrimitive> toUpload;
    4545    private HashSet<OsmPrimitive> processedPrimitives;
     46    private UploadStrategySpecification strategy;
    4647
    4748    /**
    48      *
     49     * Creates the upload task
     50     *
     51     * @param strategy the upload strategy specification
    4952     * @param layer the layer. Must not be null.
    5053     * @param monitor  a progress monitor. If monitor is null, uses {@see NullProgressMonitor#INSTANCE}
     
    5255     * @param closeChangesetAfterUpload true, if the changeset should be closed after the upload
    5356     * @throws IllegalArgumentException thrown, if layer is null
     57     * @throws IllegalArgumentException thrown if strategy is null
    5458     */
    55     public UploadLayerTask(OsmDataLayer layer, ProgressMonitor monitor, Changeset changeset, boolean closeChangesetAfterUpload) {
     59    public UploadLayerTask(UploadStrategySpecification strategy, OsmDataLayer layer, ProgressMonitor monitor, Changeset changeset, boolean closeChangesetAfterUpload) {
    5660        if (layer == null)
    57             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", layer));
     61            throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer"));
     62        if (strategy == null)
     63            throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "strategy"));
    5864        if (monitor == null) {
    5965            monitor = NullProgressMonitor.INSTANCE;
     
    6268        this.monitor = monitor;
    6369        this.changeset = changeset;
     70        this.strategy = strategy;
    6471        this.closeChangesetAfterUpload = closeChangesetAfterUpload;
    6572        processedPrimitives = new HashSet<OsmPrimitive>();
     
    103110    @Override
    104111    public void run() {
    105         monitor.subTask(tr("Preparing primitives to upload ..."));
     112        monitor.indeterminateSubTask(tr("Preparing primitives to upload ..."));
    106113        APIDataSet ds = new APIDataSet(layer.data);
    107114        try {
     
    120127                    ProgressMonitor m = monitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false);
    121128                    if (isCancelled()) return;
    122                     writer.uploadOsm(layer.data.getVersion(), toUpload, changeset, m);
     129                    writer.uploadOsm(strategy, toUpload, changeset, m);
    123130                    processedPrimitives.addAll(writer.getProcessedPrimitives());
    124131                    break;
Note: See TracChangeset for help on using the changeset viewer.