Hi to all! I need to load a file from the current directory (relative) without using the full path name (hardcoding). Currently it won't work unless I specify the full pathname e.g. E:\\Tomcat33\\webapps\\ROOT\\mysite\\myProperties.txt. As you can see by the escape characters, I'm on a Windows System. Please help me.
In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
posted 14 years ago
You should be able to just do this: fin = new FileInputStream("myfile.txt"); But if that doesn't work, you might try getting the directory from System.getProperty("user.dir"); That should give you the current working directory.