Skip to content

Commit

Permalink
feat: deprecate Readable#resource(String) and Writable#resource(String)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusshu committed Jan 2, 2024
1 parent 44ebf23 commit 4cb1b0c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion api/src/main/java/team/unnamed/creative/base/Readable.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@
*/
package team.unnamed.creative.base;

import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;

import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.OpenOption;
Expand Down Expand Up @@ -155,7 +162,10 @@ default void readAndWrite(final @NotNull OutputStream output) {
* @param name The full resource name
* @return The {@link Readable} representation
* @since 1.1.0
* @deprecated Use {@link #resource(ClassLoader, String)} instead
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.0.0")
@CallerSensitive
static @NotNull Readable resource(final @NotNull String name) {
requireNonNull(name, "name");
Expand Down
4 changes: 4 additions & 0 deletions api/src/main/java/team/unnamed/creative/base/Writable.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
package team.unnamed.creative.base;

import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;
Expand Down Expand Up @@ -140,7 +141,10 @@ public String toString() {
* @param name The full resource name
* @return The {@link Writable} representation
* @since 1.1.0
* @deprecated Use {@link #resource(ClassLoader, String)} instead
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.0.0")
@CallerSensitive
static @NotNull Writable resource(final @NotNull String name) {
requireNonNull(name, "name");
Expand Down

0 comments on commit 4cb1b0c

Please sign in to comment.