Replace deprecated calls
This commit is contained in:
parent
aecf24bbaf
commit
fc70e65c37
|
@ -3,7 +3,8 @@ package ctbrec;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URL;
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
@ -37,11 +38,11 @@ public class RecordingDownload extends MergedFfmpegHlsDownload {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void downloadFinishedRecording(String segmentPlaylistUri, File target, ProgressListener progressListener, long sizeInBytes)
|
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;
|
running = true;
|
||||||
if (Config.getInstance().getSettings().requireAuthentication) {
|
if (Config.getInstance().getSettings().requireAuthentication) {
|
||||||
URL u = new URL(segmentPlaylistUri);
|
URI uri = new URI(segmentPlaylistUri);
|
||||||
String path = u.getPath();
|
String path = uri.getPath();
|
||||||
byte[] key = Config.getInstance().getSettings().key;
|
byte[] key = Config.getInstance().getSettings().key;
|
||||||
if (!Config.getInstance().getContextPath().isEmpty()) {
|
if (!Config.getInstance().getContextPath().isEmpty()) {
|
||||||
path = path.substring(Config.getInstance().getContextPath().length());
|
path = path.substring(Config.getInstance().getContextPath().length());
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class DesktopIntegration {
|
||||||
var externalHelpers = new String[]{"kde-open5", "kde-open", "gnome-open", "xdg-open"};
|
var externalHelpers = new String[]{"kde-open5", "kde-open", "gnome-open", "xdg-open"};
|
||||||
for (String helper : externalHelpers) {
|
for (String helper : externalHelpers) {
|
||||||
try {
|
try {
|
||||||
rt.exec(helper + " " + uri);
|
rt.exec(new String[]{helper, uri});
|
||||||
return;
|
return;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.debug("Couldn't open URL with {} {}", helper, uri);
|
log.debug("Couldn't open URL with {} {}", helper, uri);
|
||||||
|
@ -117,7 +117,7 @@ public class DesktopIntegration {
|
||||||
var rt = Runtime.getRuntime();
|
var rt = Runtime.getRuntime();
|
||||||
for (String helper : externalHelpers) {
|
for (String helper : externalHelpers) {
|
||||||
try {
|
try {
|
||||||
rt.exec(helper + " " + f.getAbsolutePath());
|
rt.exec(new String[]{helper, f.getAbsolutePath()});
|
||||||
return;
|
return;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.debug("Couldn't open file with {} {}", helper, f);
|
log.debug("Couldn't open file with {} {}", helper, f);
|
||||||
|
|
Loading…
Reference in New Issue