File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes java.io Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java.io " Watch "java.io " New topic
Author

java.io

sandeep Talari
Ranch Hand

Joined: Dec 24, 2007
Posts: 63
can anybody help me regarding ,File class

this is the dought
how to make the directorys ,ok there were methods in File class named
boolean mkdir(),and boolean mkdirs().In Api its written under this method description is "Creates the directory named by this abstract pathname" what does it mean....


and there were methods like String[] list(), String[] listFiles(filefilter filter) under the description of these methods its written in Api that,"Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname" and " Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter" respectively please can anybody explain with small code piece and explain me the double coted sentences
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
Here's how to use the mkdir() in java:



As for the listFiles():




Google is a wonderful tool

Justin Fox


You down with OOP? Yeah you know me!
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 688

I think that Justin's answers are right, but I'd like to add that the difference between the methods:

mkDir();

and

mkDirs();

is that the method: mkDir() will only one directory

whereas the method mkDirs() will make as many directories as needed to make the full-path valid.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.io
 
Similar Threads
FileFilter?
reading file
How to understand this NullPointerException?
Question on the method is file
Doubt in a method of File class