Ignore:
Timestamp:
2016-01-09T16:37:20+01:00 (4 years ago)
Author:
simon04
Message:

Refactoring: introduce OsmApi#getServerUrl

Location:
trunk/src/org/openstreetmap/josm/io
Files:
4 edited

Legend:

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

    r9296 r9353  
    453453    private static void checkOfflineAccess(String urlString) {
    454454        OnlineResource.JOSM_WEBSITE.checkOfflineAccess(urlString, Main.getJOSMWebsite());
    455         OnlineResource.OSM_API.checkOfflineAccess(urlString, Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL));
     455        OnlineResource.OSM_API.checkOfflineAccess(urlString, OsmApi.getOsmApi().getServerUrl());
    456456    }
    457457
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r9352 r9353  
    340340
    341341    /**
     342     * Returns the server URL
     343     * @return the server URL
     344     * @since 9353
     345     */
     346    public String getServerUrl() {
     347        return serverUrl;
     348    }
     349
     350    /**
    342351     * Creates an OSM primitive on the server. The OsmPrimitive object passed in
    343352     * is modified by giving it the server-assigned id.
  • trunk/src/org/openstreetmap/josm/io/OsmConnection.java

    r9352 r9353  
    127127    protected void obtainAccessToken(final HttpClient connection) throws MissingOAuthAccessTokenException {
    128128        try {
    129             final URL apiUrl = new URL(Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL));
     129            final URL apiUrl = new URL(OsmApi.getOsmApi().getServerUrl());
    130130            if (!Objects.equals(apiUrl.getHost(), connection.getURL().getHost())) {
    131131                throw new MissingOAuthAccessTokenException();
  • trunk/src/org/openstreetmap/josm/io/OsmServerReader.java

    r9309 r9353  
    113113        try {
    114114            OnlineResource.JOSM_WEBSITE.checkOfflineAccess(urlStr, Main.getJOSMWebsite());
    115             OnlineResource.OSM_API.checkOfflineAccess(urlStr, Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL));
     115            OnlineResource.OSM_API.checkOfflineAccess(urlStr, OsmApi.getOsmApi().getServerUrl());
    116116
    117117            URL url = null;
Note: See TracChangeset for help on using the changeset viewer.