Get file name into a directory

hi experts,

      How to capture the file name into a specific directory? Do I need to use the package "JNDI"? Please help.
wilsontangAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
m_onkey_boyConnect With a Mentor Commented:
If I understand the question:

File f = new File("c:\\dir");
File[] aFiles = f.listFiles();
String[] aFilesByNames = f.list();
0
 
m_onkey_boyCommented:
That was to view the files in a directory.  To create a new one:

File f = new File("c:\\dir\\myFile.tmp");

FileOutputStream fis = new FileOutputStream(f);

// write to file....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.