Invalidate the cache of content for this message object, causing it to be fetched again from the server the next time it is needed. If invalidateHeaders is true, invalidate the headers as well. @param invalidateHeaders invalidate the headers as well?
(boolean invalidateHeaders)
| 281 | * @param invalidateHeaders invalidate the headers as well? |
| 282 | */ |
| 283 | public synchronized void invalidate(boolean invalidateHeaders) { |
| 284 | content = null; |
| 285 | InputStream rstream = rawData.get(); |
| 286 | if (rstream != null) { |
| 287 | // note that if the content is in the file cache, it will be lost |
| 288 | // and fetched from the server if it's needed again |
| 289 | try { |
| 290 | rstream.close(); |
| 291 | } catch (IOException ex) { |
| 292 | // ignore it |
| 293 | } |
| 294 | rawData = new SoftReference<>(null); |
| 295 | } |
| 296 | if (contentStream != null) { |
| 297 | try { |
| 298 | contentStream.close(); |
| 299 | } catch (IOException ex) { |
| 300 | // ignore it |
| 301 | } |
| 302 | contentStream = null; |
| 303 | } |
| 304 | msgSize = -1; |
| 305 | if (invalidateHeaders) { |
| 306 | headers = null; |
| 307 | hdrSize = -1; |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | /** |
| 312 | * Fetch the header of the message and the first <code>n</code> lines |