Ignore:
Timestamp:
2018-08-12T14:45:46+02:00 (6 years ago)
Author:
Don-vip
Message:

see #15229 - code refactoring - add PlatformHook.getPossiblePreferenceDirs()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r13791 r14144  
    6565import java.util.Collection;
    6666import java.util.Enumeration;
     67import java.util.HashSet;
    6768import java.util.List;
    6869import java.util.Locale;
    6970import java.util.Properties;
     71import java.util.Set;
    7072import java.util.concurrent.ExecutionException;
    7173import java.util.concurrent.TimeUnit;
     
    781783        return file;
    782784    }
     785
     786    @Override
     787    public Collection<String> getPossiblePreferenceDirs() {
     788        Set<String> locations = new HashSet<>();
     789        String appdata = getSystemEnv("APPDATA");
     790        if (appdata != null && getSystemEnv("ALLUSERSPROFILE") != null
     791                && appdata.lastIndexOf(File.separator) != -1) {
     792            appdata = appdata.substring(appdata.lastIndexOf(File.separator));
     793            locations.add(new File(new File(getSystemEnv("ALLUSERSPROFILE"), appdata), "JOSM").getPath());
     794        }
     795        return locations;
     796    }
    783797}
Note: See TracChangeset for help on using the changeset viewer.