How to create a directory and sub directory structure with java?

Gopal00005

Hello there I want to create the directories and sub directories with the java. My directory structure is starts from the current application directory, Means in current projects directory which looks like following...

Images
   |
   |+ Background
   |
   |+ Foreground
          |
          |+Necklace
          |+Earrings
          |+Etc...

I know how to create directory but I need to create sub directory I tried with following code what should be next steps ?

File file = new File("Images");
file.mkdir();
Michael Aaron Safyan

You can use File.mkdir() or File.mkdirs() to create a directory. Between the two, the latter method is more tolerant and will create all intermediate directories as needed. Also, since I see that you use "\\" in your question, I would suggest using File.separator for a portable path separator string.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to create a directory structure in bazel

From Dev

How to create a tar of directory structure

From Dev

How to create a Sub-directory in parent directory using php?

From Dev

How to create a Sub-directory in parent directory using php?

From Dev

Can gradle create the java project directory structure?

From Dev

How to create temporary directory structure with files

From Dev

How to create a complete directory structure with a single command?

From Dev

How to create a database directory structure for MySQL?

From Dev

Parsing a directory structure in Java

From Dev

sub directory and main directory monitoring in java

From Dev

How to create directory junctions for multiple sub-directories using PowerShell?

From Dev

"bound method": How to create a file name in sub directory with python

From Dev

How do you create a sub-directory for a website?

From Dev

How to create sub domain and directory with dot dot. without slash

From Dev

How to get parent directory and sub directory for file

From Dev

How to rewrite directory from root to sub directory?

From Dev

How to rewrite directory from root to sub directory?

From Dev

Linux script to create a directory structure

From Dev

Copy specific sub-directory and keep directory tree structure

From Dev

Java import sub-sub directory

From Dev

How can I create a new Symfony project with the new directory structure?

From Dev

How to create the EAR directory structure for App Engine projects automatically in Eclipse?

From Dev

How to create the EAR directory structure for App Engine projects automatically in Eclipse?

From Dev

How can I create a directory structure that includes copies of particular files?

From Dev

How to create Tree Structure of Directory with check box using Tkinter

From Dev

How to get sub directory in android?

From Dev

How to create /etc/.java/deployment directory

From Dev

How to create /etc/.java/deployment directory

From Dev

Copying Directory and sub directory

Related Related

  1. 1

    How to create a directory structure in bazel

  2. 2

    How to create a tar of directory structure

  3. 3

    How to create a Sub-directory in parent directory using php?

  4. 4

    How to create a Sub-directory in parent directory using php?

  5. 5

    Can gradle create the java project directory structure?

  6. 6

    How to create temporary directory structure with files

  7. 7

    How to create a complete directory structure with a single command?

  8. 8

    How to create a database directory structure for MySQL?

  9. 9

    Parsing a directory structure in Java

  10. 10

    sub directory and main directory monitoring in java

  11. 11

    How to create directory junctions for multiple sub-directories using PowerShell?

  12. 12

    "bound method": How to create a file name in sub directory with python

  13. 13

    How do you create a sub-directory for a website?

  14. 14

    How to create sub domain and directory with dot dot. without slash

  15. 15

    How to get parent directory and sub directory for file

  16. 16

    How to rewrite directory from root to sub directory?

  17. 17

    How to rewrite directory from root to sub directory?

  18. 18

    Linux script to create a directory structure

  19. 19

    Copy specific sub-directory and keep directory tree structure

  20. 20

    Java import sub-sub directory

  21. 21

    How can I create a new Symfony project with the new directory structure?

  22. 22

    How to create the EAR directory structure for App Engine projects automatically in Eclipse?

  23. 23

    How to create the EAR directory structure for App Engine projects automatically in Eclipse?

  24. 24

    How can I create a directory structure that includes copies of particular files?

  25. 25

    How to create Tree Structure of Directory with check box using Tkinter

  26. 26

    How to get sub directory in android?

  27. 27

    How to create /etc/.java/deployment directory

  28. 28

    How to create /etc/.java/deployment directory

  29. 29

    Copying Directory and sub directory

HotTag

Archive