Changeset 3321 in josm for trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
- Timestamp:
- 2010-06-08T21:56:38+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
r3083 r3321 72 72 * than one files have this extension, the last file whose name includes <code>namepart</code> 73 73 * is opened. 74 * 74 * 75 75 * @param extension the extension of the file we're looking for 76 76 * @param namepart the name part … … 104 104 if(file.getName().endsWith(".zip")) { 105 105 System.err.println(tr("Warning: failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}", 106 file.getName(), e.toString(), extension, namepart));106 file.getName(), e.toString(), extension, namepart)); 107 107 } 108 108 } … … 140 140 } 141 141 142 private File checkLocal(URL url, String destDir, long maxTime) {142 private File checkLocal(URL url, String destDir, long maxTime) throws IOException { 143 143 String localPath = Main.pref.get("mirror." + url); 144 144 File file = null; … … 171 171 URLConnection conn = url.openConnection(); 172 172 conn.setConnectTimeout(5000); 173 conn.setReadTimeout(5000); 173 174 bis = new BufferedInputStream(conn.getInputStream()); 174 175 bos = new BufferedOutputStream( new FileOutputStream(destDirFile)); … … 178 179 bos.write(buffer, 0, length); 179 180 } 180 } catch(IOException ioe) {181 if (file != null)182 return file;183 return null;184 181 } finally { 185 182 if (bis != null) {
Note:
See TracChangeset
for help on using the changeset viewer.