Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 993755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:28:25+00:00 2026-05-16T06:28:25+00:00

I need to create a Lucene index on a Java EE application startup, but

  • 0

I need to create a Lucene index on a Java EE application startup, but I do not want to decide on the location of the index in filesystem myself. How do applications in general store any files created while running, is there any kind of store provided by the engine per application basis etc. that I can use.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:28:25+00:00Added an answer on May 16, 2026 at 6:28 am

    I do not want to decide on the location of the index in filesystem myself. How do applications in general store any files created while running, is there any kind of store provided by the engine per application basis etc

    By default the classes in the java.io package resolve relative pathnames against the current working directory – i.e. the location in the file system from where the java command was invoked – that you can get using the user.dir system property:

    String curDir = System.getProperty("user.dir"); 
    

    But doing this is far from ideal (actually, writing to files is not ideal for portable applications) and I don’t recommend this approach but suggest using absolutes filesystem paths and e.g. system properties:

    new File(System.getProperty("my.directory" + File.separator + "xxx");
    

    Where the property my.directory would be set in the app server startup script e.g. assuming JBoss is installed under /opt, using -Dmy.directory=/var/opt/jboss/<somedir> to be FHS compliant.

    Just keep in mind that:

    • Writing to the FS is not ideal for application portability. Prefer writing to a database if possible
    • Using java.io from EJBs is in theory forbidden.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need create clone repository. but I do not know where can I get
I need create a document word with Java. And I ask, how can I
I need to access a lucene index ( created by crawling several webpages using
I need create custom tabbar with super class UITabBarController. But i don,t know how
I create service and I need create class MyErrors (not exception) My web method
I need to convert an index generated by Apache Lucene into another collection representation.
i found XMPP on google (i need create a application IM look like Yahoo
I want add new user from another script and I need create password for
In Lucene.Net, I need to create a query to limit a search to a
I need create a list of RadioButtons, but if I try to do it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.