因此,这一条线使返回无效。 在创建这一档案的同时,我做了什么错误呢?
FileInputStream fin = new FileInputStream(new File(getClass().getResource("data/levellocks.lv").toURI()));
因此,这一条线使返回无效。 在创建这一档案的同时,我做了什么错误呢?
FileInputStream fin = new FileInputStream(new File(getClass().getResource("data/levellocks.lv").toURI()));
除非你真的需要文件输入,否则可以简化以下几条:
InputStream in = getClass().getResourceAsStream("data/levellocks.lv");
类别:植被资源与类别。 AsStream与一揽子计划相对应。 为了获得有关班轮根的档案,你可以将这些方法带上班轮:
InputStream in = getClass().getClassLoader().getResourceAsStream("data/levellocks.lv");
你们是否确保档案存放在你的双亲手上,紧接上了class子的档案? 不仅在您的消息来源中,在.案卷的旁边,也不是在你手上?
唯一可以取消的事物是获得资源(“数据/级数据”。
要么获得地图集,要么获得资源,要么放弃。 否则,一切都会成功或成为例外。
我实际上刚刚处理过这个问题(我没有专家),但试图弄清,看施工者试图把名字上去。 对我来说,这是这一类的一揽子方案。 因此,当我把档案放在预期的夹中时,它就发现。
你们可能会有不同,因为我用ven子。 但是,我把它放在了北极圈/主要/资源中,却看不到。 当我在 com/主要/资源中设置一个倍数结构时,发现它。
Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...
Check this, List<String> list = new ArrayList<String>(); for (int i = 0; i < 10000; i++) { String value = (""+UUID.randomUUID().getLeastSignificantBits()).substring(3, ...
I am in the middle of solving a problem where I think it s best suited for a decorator and a state pattern. The high level setting is something like a sandwich maker and dispenser, where I have a set ...
I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I ...
I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...
If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...
I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....
I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...