Skip to content

Commit 8a9716b

Browse files
committed
1.51
1 parent 44cdc05 commit 8a9716b

File tree

6 files changed

+24
-7
lines changed

6 files changed

+24
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package dev.felnull.fnjl;
22

33
public class FNJLBuildIn {
4-
protected static final String VERSION = "1.50";
4+
protected static final String VERSION = "1.51";
55
}

common/src/main/java/dev/felnull/fnjl/io/PostResponse.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ public String getEncoding() {
2828

2929
public String getResponseString() {
3030
try {
31+
if (encoding == null)
32+
return new String(response);
3133
return new String(response, encoding);
3234
} catch (UnsupportedEncodingException e) {
33-
throw new RuntimeException(e);
35+
return new String(response);
3436
}
3537
}
3638
}

common/src/main/java/dev/felnull/fnjl/util/FNDataUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.net.URL;
99
import java.nio.charset.Charset;
1010
import java.nio.charset.StandardCharsets;
11+
import java.nio.file.Files;
1112
import java.nio.file.Path;
1213
import java.nio.file.WatchEvent;
1314
import java.security.MessageDigest;
@@ -267,7 +268,7 @@ public static byte[] urlLoadToProgress(URL url, Consumer<ProgressWriter.WritePro
267268
* @throws IOException 例外
268269
*/
269270
public static byte[] fileLoadToProgress(File file, Consumer<ProgressWriter.WriteProgressListener> progress) throws IOException {
270-
return loadToProgress(new FileInputStream(file), file.length(), progress);
271+
return loadToProgress(Files.newInputStream(file.toPath()), file.length(), progress);
271272
}
272273

273274
/**

common/src/main/java/dev/felnull/fnjl/util/FNStringUtil.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package dev.felnull.fnjl.util;
22

33

4-
import org.jetbrains.annotations.NotNull;
54
import org.jetbrains.annotations.Nullable;
65

76
import java.nio.charset.StandardCharsets;
@@ -229,14 +228,29 @@ public static UUID fromNoHyphenStringToUUID(String uuidStr) {
229228
return UUID.fromString(uuidStr.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5"));
230229
}
231230

231+
/**
232+
* 変換で着ない場合はnullを返す
233+
*
234+
* @param text ハイフン無しUUID文字列
235+
* @return uuid
236+
*/
237+
@Nullable
238+
public static UUID getUUIDFromNoHyphenStringNonThrow(String text) {
239+
try {
240+
return fromNoHyphenStringToUUID(text);
241+
} catch (Exception ignored) {
242+
}
243+
return null;
244+
}
245+
232246
/**
233247
* 変換で着ない場合はnullを返す
234248
*
235249
* @param text uuid文字列
236250
* @return uuid
237251
*/
238252
@Nullable
239-
public static UUID getUUIDFromStringNonThrow(@NotNull String text) {
253+
public static UUID getUUIDFromStringNonThrow(String text) {
240254
try {
241255
return UUID.fromString(text);
242256
} catch (Exception ignored) {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fnjl_group=dev.felnull
22
fnjl_name=felnull-java-library
3-
fnjl_version=1.50
3+
fnjl_version=1.51
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.felnull.fnjln;
22

33
public class FNJLNBuildIn {
4-
protected static final String VERSION = "1.50";
4+
protected static final String VERSION = "1.51";
55

66
protected static final int NATIVE_LIBRARY_VERSION = 1;
77
}

0 commit comments

Comments
 (0)