Results 1 to 3 of 3
- 10-26-2009, 10:01 PM #1
Member
- Join Date
- Oct 2009
- Posts
- 3
- Rep Power
- 0
Create a folder within a java program.
I currently have a large file that I want to seperate into (20) different files, which are then seperated by different criteria into more (3+) files. As you can see, this results in over 80 files in one place. If I could, I would like to seperate these files into folders for organization.
The reading and writing runs fine, the only problem is that I have no idea how to create folders without manually creating them beforehand. Is there any way to do this within the program?
If it matters, this is in command prompt in JCreator. I am using a Scanner and a BufferredWriter.
If this is in the wrong place or has been answered already, sorry; I'm new, and I couldn't find the topic elsewhere.
- 10-26-2009, 10:09 PM #2
Member
- Join Date
- Oct 2009
- Posts
- 25
- Rep Power
- 0
A directory (or folder) is simply a file that points to another list of files. Thus, if you look at the java.io.File API, you will see methods like isDirectory() and mkdir().
So, to create a directory...
Java Code:File f = new File("c:\newfolder"); f.mkdir();
- 10-26-2009, 10:14 PM #3
Member
- Join Date
- Oct 2009
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
code to create a folder in java
By radhika123 in forum New To JavaReplies: 7Last Post: 07-21-2011, 11:21 AM -
How to create an access folder for a project in the Jboss server
By satya kishore in forum Web FrameworksReplies: 0Last Post: 02-09-2009, 12:31 PM -
Need help - Create an application to loop through folder of images & insert to db
By kissiffer4 in forum SWT / JFaceReplies: 2Last Post: 11-21-2008, 05:59 PM -
How to create Folder View
By jazz2k8 in forum Advanced JavaReplies: 2Last Post: 10-24-2008, 02:04 PM -
How to create folder(s) and store data?
By Grom in forum New To JavaReplies: 2Last Post: 08-20-2008, 09:01 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks