好的,所以当我使用ClassLoader.getSystemResourceAsStream
时,它只会工作,有时它会找到文件,它会返回true,然后有时会返回false,这是我的代码
InputStream ffmpegStream = ClassLoader.getSystemResourceAsStream("bin");
InputStream ffplayStream = ClassLoader.getSystemResourceAsStream("bin//ffplay.exe");
InputStream ffprobeStream = ClassLoader.getSystemResourceAsStream("bin//ffprobe.exe");
File MainConfigFile = new File(this.getMainConfigLocation());
File FFMPEGFile = new File(ffmpegStream.toString());
File FFMPEGFileInstallLocation = new File(FFMPEGInstallDirectory);
File FFPLAYFile = new File(ffplayStream.toString());
File FFPLAYFileInstallLocation = new File(FFPlayInstallDirectory);
File FFPROBEFile = new File(ffprobeStream.toString());
File FFPROBEFileInstallLocation = new File(FFProbeInstallDirectory);
FFMPEGFile.renameTo(FFMPEGFileInstallLocation);
FFPLAYFile.renameTo(FFPLAYFileInstallLocation);
FFPROBEFile.renameTo(FFPROBEFileInstallLocation);
System.out.println(FFMPEGFile.exists());
System.exit(0);