Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a31395e

Browse filesBrowse files
committed
Signature fix for Java5
1 parent 397886d commit a31395e
Copy full SHA for a31395e

File tree

Expand file treeCollapse file tree

2 files changed

+17
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+17
-5
lines changed

‎src/main/java/org/kohsuke/github/GHContent.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHContent.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public String getPath() {
7878
*/
7979
@SuppressFBWarnings("DM_DEFAULT_ENCODING")
8080
public String getContent() throws IOException {
81-
return new String(DatatypeConverter.parseBase64Binary(getEncodedContent()));
81+
return new String(Base64.decodeBase64(getEncodedContent()));
8282
}
8383

8484
/**
@@ -179,7 +179,7 @@ public GHContentUpdateResponse update(byte[] newContentBytes, String commitMessa
179179
}
180180

181181
public GHContentUpdateResponse update(byte[] newContentBytes, String commitMessage, String branch) throws IOException {
182-
String encodedContent = DatatypeConverter.printBase64Binary(newContentBytes);
182+
String encodedContent = Base64.encodeBase64String(newContentBytes);
183183

184184
Requester requester = new Requester(root)
185185
.with("path", path)

‎src/main/java/org/kohsuke/github/GHRepository.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRepository.java
+15-3Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,29 @@
2626
import com.fasterxml.jackson.annotation.JsonProperty;
2727
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
2828
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
29+
import org.apache.commons.codec.binary.Base64;
2930
import org.apache.commons.lang.StringUtils;
3031

31-
import javax.xml.bind.DatatypeConverter;
3232
import java.io.FileNotFoundException;
3333
import java.io.IOException;
3434
import java.io.InputStreamReader;
3535
import java.io.InterruptedIOException;
3636
import java.io.Reader;
3737
import java.io.UnsupportedEncodingException;
3838
import java.net.URL;
39-
import java.util.*;
39+
import java.util.AbstractSet;
40+
import java.util.ArrayList;
41+
import java.util.Arrays;
42+
import java.util.Collection;
43+
import java.util.Collections;
44+
import java.util.Date;
45+
import java.util.HashMap;
46+
import java.util.HashSet;
47+
import java.util.Iterator;
48+
import java.util.List;
49+
import java.util.Map;
50+
import java.util.Set;
51+
import java.util.TreeMap;
4052

4153
import static java.util.Arrays.asList;
4254

@@ -1165,7 +1177,7 @@ public GHContentUpdateResponse createContent(byte[] contentBytes, String commitM
11651177
Requester requester = new Requester(root)
11661178
.with("path", path)
11671179
.with("message", commitMessage)
1168-
.with("content", DatatypeConverter.printBase64Binary(contentBytes))
1180+
.with("content", Base64.encodeBase64String(contentBytes))
11691181
.method("PUT");
11701182

11711183
if (branch != null) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.