Last change
on this file since 17335 was 16427, checked in by simon04, 4 years ago |
see #18712 - Add OfflineAccessException.forResource(String)
|
-
Property svn:eol-style
set to
native
|
File size:
896 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.io;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * Exception thrown when an online resource is accessed while in offline mode.
|
---|
8 | * @since 7434
|
---|
9 | */
|
---|
10 | public class OfflineAccessException extends IllegalStateException {
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * Constructs a new {@code OfflineAccessException}.
|
---|
14 | * @param s the String that contains a detailed message
|
---|
15 | */
|
---|
16 | public OfflineAccessException(String s) {
|
---|
17 | super(s);
|
---|
18 | }
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Returns a new OfflineAccessException with a translated message for the given resource
|
---|
22 | * @param name the translated name/description of the resource
|
---|
23 | * @return a new OfflineAccessException
|
---|
24 | */
|
---|
25 | public static OfflineAccessException forResource(String name) {
|
---|
26 | return new OfflineAccessException(tr("{0} not available (offline mode)", name));
|
---|
27 | }
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.