IntelliJ IDEA 2018.1 Help

Resource Files

Resources include properties files, images, DTDs, and XML files. These files are located in the Classpath of your application, and are usually loaded from the Classpath using the following methods:

  • ResourceBundle.getBundle() for properties files and resource bundles
  • loadResourceAsStream() for icons and other files

When building an application, IntelliJ IDEA copies all resources into the output directory, preserving the directory structure of the resources relative to the source path. The following file types are recognized as resources by default:

.dtd.jpeg.properties
.gif.jpg.tld
.html.png.xml

The pattern of recognized resource files can be configured as a regular expression in the Compiler dialog. Using the Resource Patterns text box, you can add your own file extensions and create custom list of resources.

Last modified: 26 June 2018