Skip to content

Commit

Permalink
fix: removed deprecated methods from IOHelpers class
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa authored Oct 22, 2024
1 parent 7537d5b commit c2fcc35
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* Fix #6081: Moved Java baseline from 8 (1.8) to 11
* Fix #6138: Removed unused `io:fabric8:kubernetes-model` artifact
* Fix #6156: Removed deprecated extension `io:fabric8:service-catalog`
* Fix #6158: Removed deprecated methods from `io.fabric8.kubernetes.client.utils.IOHelpers`

### 6.13.4 (2024-09-25)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/
package io.fabric8.kubernetes.client.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -28,8 +24,6 @@
import java.io.Writer;
import java.nio.charset.Charset;

/**
*/
public class IOHelpers {
private IOHelpers() {
throw new IllegalStateException("Utility class");
Expand Down Expand Up @@ -65,37 +59,4 @@ private static void copy(Reader reader, Writer writer) throws IOException {
}
}

/**
* @deprecated will be removed in future versions
*/
@Deprecated
public static boolean isJSONValid(String json) {
try {
ObjectMapper objectMapper = Serialization.jsonMapper();
objectMapper.readTree(json);
} catch (JsonProcessingException e) {
return false;
}
return true;
}

/**
* @deprecated will be removed in future versions
*/
@Deprecated
public static String convertYamlToJson(String yaml) {
return Serialization.asJson(Serialization.unmarshal(yaml, JsonNode.class));
}

/**
* @deprecated will be removed in future versions
*/
@Deprecated
public static String convertToJson(String jsonOrYaml) {
if (isJSONValid(jsonOrYaml)) {
return jsonOrYaml;
}
return convertYamlToJson(jsonOrYaml);
}

}

0 comments on commit c2fcc35

Please sign in to comment.