Ignore:
Timestamp:
2017-09-14T15:09:01+02:00 (2 years ago)
Author:
bastiK
Message:

see #15229 - add parameter to base directory methods

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
3 edited

Legend:

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

    r12855 r12856  
    928928    private static ImageResource getIfAvailableHttp(String url, ImageType type) {
    929929        try (CachedFile cf = new CachedFile(url).setDestDir(
    930                 new File(Config.getDirs().getCacheDirectory(), "images").getPath());
     930                new File(Config.getDirs().getCacheDirectory(true), "images").getPath());
    931931             InputStream is = cf.getInputStream()) {
    932932            switch (type) {
     
    11741174        // Try user-data directory
    11751175        if (Config.getDirs() != null) {
    1176             String dir = new File(Config.getDirs().getUserDataDirectory(), "images").getAbsolutePath();
     1176            String dir = new File(Config.getDirs().getUserDataDirectory(false), "images").getAbsolutePath();
    11771177            try {
    11781178                u = getImageUrl(dir, imageName, additionalClassLoaders);
     
    12481248
    12491249            try (CachedFile cf = new CachedFile(base + fn).setDestDir(
    1250                         new File(Config.getDirs().getUserDataDirectory(), "images").getPath());
     1250                        new File(Config.getDirs().getUserDataDirectory(true), "images").getPath());
    12511251                 InputStream is = cf.getInputStream()) {
    12521252                parser.parse(new InputSource(is));
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r12855 r12856  
    477477    public File getDefaultUserDataDirectory() {
    478478        // Use preferences directory by default
    479         return Config.getDirs().getPreferencesDirectory();
     479        return Config.getDirs().getPreferencesDirectory(false);
    480480    }
    481481
     
    522522            props.load(fis);
    523523            byte[] content = Files.readAllBytes(templateFile);
    524             File cachePath = Config.getDirs().getCacheDirectory();
     524            File cachePath = Config.getDirs().getCacheDirectory(true);
    525525            Path fontconfigFile = cachePath.toPath().resolve("fontconfig.properties");
    526526            OutputStream os = Files.newOutputStream(fontconfigFile);
  • trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java

    r12855 r12856  
    153153    private static void saveOptimizedBoundaries(Collection<Way> optimizedWays) {
    154154        DataSet ds = optimizedWays.iterator().next().getDataSet();
    155         File file = new File(Config.getDirs().getCacheDirectory(), "left-right-hand-traffic.osm");
     155        File file = new File(Config.getDirs().getCacheDirectory(true), "left-right-hand-traffic.osm");
    156156        try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);
    157157             OsmWriter w = OsmWriterFactory.createOsmWriter(new PrintWriter(writer), false, ds.getVersion())
     
    166166
    167167    private static Collection<Way> loadOptimizedBoundaries() {
    168         try (InputStream is = new FileInputStream(new File(Config.getDirs().getCacheDirectory(), "left-right-hand-traffic.osm"))) {
     168        try (InputStream is = new FileInputStream(new File(
     169                Config.getDirs().getCacheDirectory(false), "left-right-hand-traffic.osm"))) {
    169170           return OsmReader.parseDataSet(is, null).getWays();
    170171        } catch (IllegalDataException | IOException ex) {
Note: See TracChangeset for help on using the changeset viewer.