title: How to write new subfolders in java?
body: <p>I'm processing some .xml files by using XSLT.</p>
  <p>By doing this</p>
  <pre class="lang-java prettyprint-override"><code>
  public static void main(final String[] args) throws Exception {
          final Transformer transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(
                  Paths.get(&quot;/myPath/myfile.xsl&quot;).toFile()));
          new XsltTransformer(Paths.get(&quot;/mypath/source_files&quot;),
                  Paths.get(&quot;/mypath/target_files&quot;), transformer)
                          .run();
      }
  </code></pre>
  <p>I'm able to transform all the .xml files from <code>source_files</code> folder and save the resulting files in <code>target_files</code>. By adding a subfolder to my <code>source_file</code> like <code>/mypath/source_files/test</code> I'm having this error:</p>
  <pre><code>Exception in thread &quot;main&quot; java.lang.IllegalStateException: javax.xml.transform.TransformerException: java.io.FileNotFoundException: /mypath/target_files/test/test.xml (No such file or directory)
  </code></pre>
  <p>So, the source path and the target path must be the same.</p>
  <p>How to fix this issue?</p>