Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Get file name into a directory

Posted on 2002-03-07
2
Medium Priority
?
215 Views
Last Modified: 2010-03-31
hi experts,

      How to capture the file name into a specific directory? Do I need to use the package "JNDI"? Please help.
0
Comment
Question by:wilsontang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
m_onkey_boy earned 300 total points
ID: 6849818
If I understand the question:

File f = new File("c:\\dir");
File[] aFiles = f.listFiles();
String[] aFilesByNames = f.list();
0
 
LVL 4

Expert Comment

by:m_onkey_boy
ID: 6849819
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question