mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-06-18 14:50:56 +00:00
changed java 7 specific code to java 6 compatible
This commit is contained in:
@@ -2,13 +2,9 @@ package com.limelight;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.nio.file.Files;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.UIManager;
|
||||
@@ -43,13 +39,23 @@ public class Limelight implements NvConnectionListener {
|
||||
}
|
||||
File destination = new File(targetDirectory+File.separatorChar+libraryName);
|
||||
|
||||
try {
|
||||
Files.deleteIfExists(destination.toPath());
|
||||
} catch (IOException e) {
|
||||
// Try the copy anyway
|
||||
}
|
||||
// this will only delete it if it exists, and then create a new file
|
||||
destination.delete();
|
||||
destination.createNewFile();
|
||||
|
||||
Files.copy(resource, destination.toPath());
|
||||
//this is the janky java 6 way to copy a file
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
fos = new FileOutputStream(destination);
|
||||
int read;
|
||||
while ((read = resource.read()) != -1) {
|
||||
fos.write(read);
|
||||
}
|
||||
} finally {
|
||||
if (fos != null) {
|
||||
fos.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void prepareNativeLibraries() throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user