Replace deprecated calls

This commit is contained in:
jafea7 2025-05-03 15:11:51 +10:00
parent aecf24bbaf
commit fc70e65c37
2 changed files with 7 additions and 6 deletions

View File

@ -3,7 +3,8 @@ package ctbrec;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.time.Instant;
@ -37,11 +38,11 @@ public class RecordingDownload extends MergedFfmpegHlsDownload {
}
public void downloadFinishedRecording(String segmentPlaylistUri, File target, ProgressListener progressListener, long sizeInBytes)
throws InvalidKeyException, NoSuchAlgorithmException, IllegalStateException, InterruptedException, IOException, ParseException, PlaylistException {
throws InvalidKeyException, NoSuchAlgorithmException, IllegalStateException, InterruptedException, IOException, ParseException, PlaylistException, URISyntaxException {
running = true;
if (Config.getInstance().getSettings().requireAuthentication) {
URL u = new URL(segmentPlaylistUri);
String path = u.getPath();
URI uri = new URI(segmentPlaylistUri);
String path = uri.getPath();
byte[] key = Config.getInstance().getSettings().key;
if (!Config.getInstance().getContextPath().isEmpty()) {
path = path.substring(Config.getInstance().getContextPath().length());

View File

@ -64,7 +64,7 @@ public class DesktopIntegration {
var externalHelpers = new String[]{"kde-open5", "kde-open", "gnome-open", "xdg-open"};
for (String helper : externalHelpers) {
try {
rt.exec(helper + " " + uri);
rt.exec(new String[]{helper, uri});
return;
} catch (IOException e) {
log.debug("Couldn't open URL with {} {}", helper, uri);
@ -117,7 +117,7 @@ public class DesktopIntegration {
var rt = Runtime.getRuntime();
for (String helper : externalHelpers) {
try {
rt.exec(helper + " " + f.getAbsolutePath());
rt.exec(new String[]{helper, f.getAbsolutePath()});
return;
} catch (IOException e) {
log.debug("Couldn't open file with {} {}", helper, f);