• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jar file generation  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am generating a jar file for my portlet development. I need to read a text file for data. I can hard-code the absolute path of the file on my laptop and the code runs fine. But the jar will eventually be deployed onto the application server. How could I specify the path of the text file so that my jar file will work on both my laptop and the application server?
 
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could a resource reference in the web module do the trick for you?

-Cameron McKenzie
 
author
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In Liferay, we can refer any contents as

/package-name/path/filename

in Tomcat /webapps/...
 
Xinsheng Chen
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This helps.

Thank you, Jonas!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!