Files
openide/java/java-impl/resources/inspectionDescriptions/HardcodedFileSeparators.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

22 lines
1.0 KiB
HTML

<html>
<body>
Reports the forward (<code>/</code>) or backward (<code>\</code>) slash in a string or
character literal. These characters are commonly used as file separators, and portability may suffer if they are hardcoded.
<p>
The inspection will not report backward slashes inside escape sequences and forward slashes immediately following the '&lt;' character
or immediately preceding the '&gt;' character, as those often indicate XML or HTML tags rather than file names.
Strings representing a <code>java.util.TimeZone</code> ID, strings that are valid regular expressions,
or strings that equal IANA-registered MIME media types will not be reported either.
</p>
<p><b>Example:</b></p>
<pre><code>
new File("C:\\Users\\Name");
</code></pre>
<!-- tooltip end -->
<p>
Use the option to include <code>example/*</code> in the set of recognized media types.
Normally, usage of the <code>example/*</code> MIME media type outside of an example (e.g. in a <code>Content-Type</code>
header) is an error.
</p>
</body>
</html>