File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
src/main/java/me/desair/tus/server Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 3737 <artifactId >commons-io</artifactId >
3838 <version >2.6</version >
3939 </dependency >
40+ <dependency >
41+ <groupId >commons-codec</groupId >
42+ <artifactId >commons-codec</artifactId >
43+ <version >1.11</version >
44+ </dependency >
4045 <dependency >
4146 <groupId >org.slf4j</groupId >
4247 <artifactId >slf4j-api</artifactId >
Original file line number Diff line number Diff line change 99import java .util .TreeMap ;
1010import java .util .UUID ;
1111
12- import javax .xml .bind .DatatypeConverter ;
13-
12+ import org .apache .commons .codec .binary .Base64 ;
1413import org .apache .commons .lang3 .StringUtils ;
1514import org .apache .commons .lang3 .builder .EqualsBuilder ;
1615import org .apache .commons .lang3 .builder .HashCodeBuilder ;
@@ -254,7 +253,7 @@ private String decode(String encodedValue) {
254253 if (encodedValue == null ) {
255254 return null ;
256255 } else {
257- return new String (DatatypeConverter . parseBase64Binary (encodedValue ), Charset .forName ("UTF-8" ));
256+ return new String (Base64 . decodeBase64 (encodedValue ), Charset .forName ("UTF-8" ));
258257 }
259258 }
260259}
Original file line number Diff line number Diff line change 1515
1616import javax .servlet .http .HttpServletRequest ;
1717import javax .servlet .http .HttpServletRequestWrapper ;
18- import javax .xml .bind .DatatypeConverter ;
18+
19+ import org .apache .commons .codec .binary .Base64 ;
20+ import org .apache .commons .io .input .CountingInputStream ;
21+ import org .apache .commons .lang3 .StringUtils ;
1922
2023import me .desair .tus .server .HttpHeader ;
2124import me .desair .tus .server .TusExtension ;
2225import me .desair .tus .server .checksum .ChecksumAlgorithm ;
23- import org .apache .commons .io .input .CountingInputStream ;
24- import org .apache .commons .lang3 .StringUtils ;
2526
2627public class TusServletRequest extends HttpServletRequestWrapper {
2728
@@ -106,7 +107,7 @@ public boolean hasCalculatedChecksum() {
106107 public String getCalculatedChecksum (ChecksumAlgorithm algorithm ) {
107108 MessageDigest messageDigest = getMessageDigest (algorithm );
108109 return messageDigest == null ? null :
109- DatatypeConverter . printBase64Binary (messageDigest .digest ());
110+ Base64 . encodeBase64String (messageDigest .digest ());
110111 }
111112
112113 /**
You can’t perform that action at this time.
0 commit comments