0

Ok so when i use ClassLoader.getSystemResourceAsStream it will only work sometimes, sometimes it will find the file and it will return true and then sometimes it will return false here is my code

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);
Bhesh Gurung
  • 50,430
  • 22
  • 93
  • 142
  • possible duplicate of [How to find out why renameTo() failed?](http://stackoverflow.com/questions/1325388/how-to-find-out-why-renameto-failed) – Leo Mar 07 '14 at 16:10
  • I think the file may be open sometimes – Leo Mar 07 '14 at 16:11
  • Leo how do i tell if the Stream is open sometimes im not having A promblom with renameto im having A problom with getting the data from the stream most of the time it will return false even though the file is there if you know any way that could help me please contact me at my skype vxwkillerj – VxwkillerjTheWalrus Mar 07 '14 at 22:00

0 Answers0