title: Create folders programmatically along with permissions using java to save content to that location
body: <p>I have xampp installed in my windows system and lampp installed in my linux system. I want to create folder in the location "<a href="http://localhost/" rel="nofollow noreferrer">http://localhost/</a>" using java. I have done the following :</p>
  
  <pre><code>dirName = new File("http://localhost/"+name);
  if(!dirName.exists()) {
      dirName.mkdir();
  }
  </code></pre>
  
  <p>Is it possible to do? The idea is to download some files to that location programatically. Download is working but how do I create folders so that I can access it via <code>http://example.com/name</code>. This is required to keep track of the user related content. I have access to the apache web server with lampp already installed. How can I create folders and save the downloads to that folder with programmatically assigning the permissions to the folder and contents within it so that saved contents can be download from there using <code>wget</code> method.</p>