Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 4 characters in body
Source Link
dash1e
  • 7.8k
  • 1
  • 32
  • 39

You can do this:

  • Add the default configuration as an embedded resource file to the library jar
  • Then the user can override the file adding a resource with the same path to the classpath

As file format you can use the Java Properties File.

And you can load it in this way

Properties props = new Properties(); props.load(ClassLoaderYourClass.class.getResourceAsStream("name-of-your-prop-file.properties")); 

You can do this:

  • Add the default configuration as an embedded resource file to the library jar
  • Then the user can override the file adding a resource with the same path to the classpath

As file format you can use the Java Properties File.

And you can load it in this way

Properties props = new Properties(); props.load(ClassLoader.getResourceAsStream("name-of-your-prop-file.properties")); 

You can do this:

  • Add the default configuration as an embedded resource file to the library jar
  • Then the user can override the file adding a resource with the same path to the classpath

As file format you can use the Java Properties File.

And you can load it in this way

Properties props = new Properties(); props.load(YourClass.class.getResourceAsStream("name-of-your-prop-file.properties")); 
added 294 characters in body
Source Link
dash1e
  • 7.8k
  • 1
  • 32
  • 39

You can do this:

  • Add the default configuration as an embedded resource file to the library jar
  • Then the user can override the file adding a resource with the same path to the classpath

As file format you can use the Java Properties File.

And you can load it in this way

Properties props = new Properties(); props.load(ClassLoader.getResourceAsStream("name-of-your-prop-file.properties")); 

You can do this:

  • Add the default configuration as an embedded resource file to the library jar
  • Then the user can override the file adding a resource with the same path to the classpath

You can do this:

  • Add the default configuration as an embedded resource file to the library jar
  • Then the user can override the file adding a resource with the same path to the classpath

As file format you can use the Java Properties File.

And you can load it in this way

Properties props = new Properties(); props.load(ClassLoader.getResourceAsStream("name-of-your-prop-file.properties")); 
Source Link
dash1e
  • 7.8k
  • 1
  • 32
  • 39

You can do this:

  • Add the default configuration as an embedded resource file to the library jar
  • Then the user can override the file adding a resource with the same path to the classpath