diff options
author | Leo Sadovsky <Snowbridge@users.noreply.github.com> | 2023-01-26 09:50:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-26 09:50:26 +0300 |
commit | b4934e05aab6c875cd1c2d412102e041a79b9210 (patch) | |
tree | b37feb2fc95f9de276f3d1f30252063f7e689c34 /src/main/java/org/traccar/helper | |
parent | 080c289a8a29244bd46cf029eefabbe426ddd00b (diff) | |
parent | 5d572a11870b16668d2803481a2a687d3625abe0 (diff) | |
download | trackermap-server-b4934e05aab6c875cd1c2d412102e041a79b9210.tar.gz trackermap-server-b4934e05aab6c875cd1c2d412102e041a79b9210.tar.bz2 trackermap-server-b4934e05aab6c875cd1c2d412102e041a79b9210.zip |
Merge branch 'traccar:master' into master
Diffstat (limited to 'src/main/java/org/traccar/helper')
-rw-r--r-- | src/main/java/org/traccar/helper/ClassScanner.java | 2 | ||||
-rw-r--r-- | src/main/java/org/traccar/helper/StringUtil.java | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/helper/ClassScanner.java b/src/main/java/org/traccar/helper/ClassScanner.java index c928f6a12..c201d101f 100644 --- a/src/main/java/org/traccar/helper/ClassScanner.java +++ b/src/main/java/org/traccar/helper/ClassScanner.java @@ -46,7 +46,7 @@ public final class ClassScanner { URL packageUrl = baseClass.getClassLoader().getResource(packagePath); if (packageUrl.getProtocol().equals("jar")) { - String jarFileName = URLDecoder.decode(packageUrl.getFile(), StandardCharsets.UTF_8.name()); + String jarFileName = URLDecoder.decode(packageUrl.getFile(), StandardCharsets.UTF_8); try (JarFile jf = new JarFile(jarFileName.substring(5, jarFileName.indexOf("!")))) { Enumeration<JarEntry> jarEntries = jf.entries(); while (jarEntries.hasMoreElements()) { diff --git a/src/main/java/org/traccar/helper/StringUtil.java b/src/main/java/org/traccar/helper/StringUtil.java new file mode 100644 index 000000000..9b4d717f4 --- /dev/null +++ b/src/main/java/org/traccar/helper/StringUtil.java @@ -0,0 +1,32 @@ +/* + * Copyright 2023 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.helper; + +public final class StringUtil { + + private StringUtil() { + } + + public static boolean containsHex(String value) { + for (char c : value.toCharArray()) { + if (c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F') { + return true; + } + } + return false; + } + +} |