-1

I'm in doubt about something. I'm developing a Java Desktop application and I have a problem.

I need to get the current local folder that my application (jar file) is in user system. And after this, to search inside of this same folder for some files (like all .txt file, for example). And finally, get the name of only one of this files and converts to string.

Someone can help me? Antecipate thanks.

Tux123
  • 13
  • 5

1 Answers1

0

May be the getCanonicalPath() and getProperty() functions could help you, since you don't show any code I can't make you any example, but may be looking this could help you a little.

And also there is a similar question here

Community
  • 1
  • 1
Roberto
  • 35
  • 6
  • Thanks. Now I found the code to get the current local folder: `String path = MyClass.class.getProtectionDomain().getCodeSource().getLocation().getPath();` – Tux123 Jun 01 '14 at 00:45