Changeset 9995 in josm
- Timestamp:
- 2016-03-14T22:15:51+01:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r9396 r9995 58 58 import org.openstreetmap.josm.gui.preferences.server.ProxyPreference; 59 59 import org.openstreetmap.josm.gui.util.GuiHelper; 60 import org.openstreetmap.josm.io.CertificateAmendment; 60 61 import org.openstreetmap.josm.io.DefaultProxySelector; 61 62 import org.openstreetmap.josm.io.MessageNotifier; … … 401 402 } 402 403 404 try { 405 CertificateAmendment.addMissingCertificates(); 406 } catch (IOException ex) { 407 ex.printStackTrace(); 408 Main.warn(getErrorMessage(Utils.getRootCause(ex))); 409 } 403 410 Authenticator.setDefault(DefaultAuthenticator.getInstance()); 404 411 DefaultProxySelector proxySelector = new DefaultProxySelector(ProxySelector.getDefault()); -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r9977 r9995 6 6 import java.io.BufferedInputStream; 7 7 import java.io.BufferedReader; 8 import java.io.ByteArrayOutputStream; 8 9 import java.io.Closeable; 9 10 import java.io.File; … … 213 214 214 215 /** 216 * Get the full content of the requested resource as a byte array. 217 * @return the full content of the requested resource as byte array 218 * @throws IOException in case of an I/O error 219 */ 220 public byte[] getByteContent() throws IOException { 221 try (InputStream is = getInputStream()) { 222 ByteArrayOutputStream buffer = new ByteArrayOutputStream(); 223 int nRead; 224 byte[] data = new byte[8192]; 225 while ((nRead = is.read(data, 0, data.length)) != -1) { 226 buffer.write(data, 0, nRead); 227 } 228 buffer.flush(); 229 return buffer.toByteArray(); 230 } 231 } 232 233 /** 215 234 * Returns {@link #getInputStream()} wrapped in a buffered reader. 216 235 * <p>
Note:
See TracChangeset
for help on using the changeset viewer.