Ignore:
Timestamp:
2011-11-26T17:56:25+01:00 (12 years ago)
Author:
bastiK
Message:

see #7027 - internal structures for preferences (expect some problems next few days)

File:
1 edited

Legend:

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

    r4343 r4612  
    1515import java.net.URL;
    1616import java.net.URLConnection;
     17import java.util.ArrayList;
    1718import java.util.Arrays;
    1819import java.util.Collection;
    1920import java.util.Enumeration;
     21import java.util.List;
    2022import java.util.zip.ZipEntry;
    2123import java.util.zip.ZipFile;
     
    188190        long age = 0L;
    189191        File localFile = null;
    190         Collection<String> localPathEntry = Main.pref.getCollection(prefKey);
    191         if(localPathEntry.size() == 2) {
    192             String[] lp = (String[]) localPathEntry.toArray();
    193             localFile = new File(lp[1]);
     192        List<String> localPathEntry = new ArrayList<String>(Main.pref.getCollection(prefKey));
     193        if (localPathEntry.size() == 2) {
     194            localFile = new File(localPathEntry.get(1));
    194195            if(!localFile.exists())
    195196                localFile = null;
     
    200201                    maxTime = Main.pref.getInteger("mirror.maxtime", 7*24*60*60);
    201202                }
    202                 age = System.currentTimeMillis() - Long.parseLong(lp[0]);
     203                age = System.currentTimeMillis() - Long.parseLong(localPathEntry.get(0));
    203204                if (age < maxTime*1000) {
    204205                    return localFile;
Note: See TracChangeset for help on using the changeset viewer.