Java – convert ifile to file

I have an ifile object that needs to be used as a Java io. File object I am using the following code for conversion

file = ifile.getFullPath().toFile();

But for file The call to exists() returned false

Solution

You want to use iresource Getlocation () returns the local file path However, please read the Javadoc comments carefully, because you can't assume that the resource is supported by the actual file (it can be anything, depending on how the project is set up)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>